{
  "id": 370333,
  "title": "[placeholder] LB 0.58 @ 3hr : my experimental results",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/370333",
  "author_name": "hengck23",
  "post_date": "2022-12-04T00:52:36.568000",
  "votes": 199,
  "comment_count": 253,
  "views": 0,
  "content": "<p>many kagglers asked about my hardware to train large models. Here is it:</p>\n<p>\"All experiment results are only made possible by the Z8 by HP workstation with 2x A6000 48GB Nvidia GPU cards. With fast and large GPU cards, you can enjoy designing models and sleep early without worrying about out-of-memory errors :) \"</p>\n<p><img src=\"https://i.ibb.co/k35LJVp/Selection-517.png\" alt=\"https://i.ibb.co/k35LJVp/Selection-517.png\"></p>\n<pre><code>sample code:\nhttps://www.kaggle.com/code/hengck23/notebooke04a738685   \nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug   \n</code></pre>",
  "messages": [
    {
      "id": 2054227,
      "postDate": "2022-12-04T00:52:36.567Z",
      "content": "<p>many kagglers asked about my hardware to train large models. Here is it:</p>\n<p>\"All experiment results are only made possible by the Z8 by HP workstation with 2x A6000 48GB Nvidia GPU cards. With fast and large GPU cards, you can enjoy designing models and sleep early without worrying about out-of-memory errors :) \"</p>\n<p><img src=\"https://i.ibb.co/k35LJVp/Selection-517.png\" alt=\"https://i.ibb.co/k35LJVp/Selection-517.png\"></p>\n<pre><code>sample code:\nhttps://www.kaggle.com/code/hengck23/notebooke04a738685   \nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug   \n</code></pre>",
      "rawMarkdown": "many kagglers asked about my hardware to train large models. Here is it:\n\n\"All experiment results are only made possible by the Z8 by HP workstation with 2x A6000 48GB Nvidia GPU cards. With fast and large GPU cards, you can enjoy designing models and sleep early without worrying about out-of-memory errors :) \"\n\n ![https://i.ibb.co/k35LJVp/Selection-517.png](https://i.ibb.co/k35LJVp/Selection-517.png)\n\n```\nsample code:\nhttps://www.kaggle.com/code/hengck23/notebooke04a738685   \nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug   \n```\n\n\n",
      "votes": 197
    },
    {
      "id": 2109056,
      "postDate": "2023-01-21T05:12:47.273Z",
      "content": "<p>example of using rejection-based approach.<br>\nyou can improve accuracy with less computation.</p>\n<pre><code>LB : 0.58\n  test_df0 = test_df.copy()\n  probability0 = do_predict(net0, test_df0)\n  test_df0.loc[:,'cancer_p0']=probability0\n\n\n    #---\n    t = np.percentile(probability0,65) #reject 65%\n    test_df1 = test_df0[test_df0.cancer_p0&gt;t].reset_index(drop=True)\n    probability1 = do_predict(net1, test_df1)\n    test_df1.loc[:,'cancer_p1']=probability1\n\n    # ---\n\n\nLB : 0.59  (cv increase +0.02)\n    df = test_df0.merge(test_df1[['image_id','cancer_p1']],on='image_id',how='left')\n    df.loc[df.cancer_p1.isna(),'cancer_p1'] = df.cancer_p0\n    probability = (df.cancer_p0.values +  df.cancer_p1.values)/2\n\nnet0 and net1 are trained using same fold but different seed\n</code></pre>\n<p><img src=\"https://i.ibb.co/6szKVLc/Selection-613.png\" alt=\"https://i.ibb.co/6szKVLc/Selection-613.png\"></p>\n<hr>\n<p>tip:</p>\n<p>net1 can also be a network that uses higher resolution, etc </p>\n<hr>\n<p>[1]Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time</p>\n<p>use larger learning rate to learn a coarse model.<br>\nthen finetune using different seed (+ different hyperparameters, rate, weighing, etc)</p>\n<p>ensemble all using the method  in [1], i.e. just average the weights of the best k-models in greedy way.</p>",
      "rawMarkdown": "example of using rejection-based approach.\nyou can improve accuracy with less computation.\n\n```\nLB : 0.58\n  test_df0 = test_df.copy()\n  probability0 = do_predict(net0, test_df0)\n  test_df0.loc[:,'cancer_p0']=probability0\n\n\n    #---\n    t = np.percentile(probability0,65) #reject 65%\n    test_df1 = test_df0[test_df0.cancer_p0>t].reset_index(drop=True)\n    probability1 = do_predict(net1, test_df1)\n    test_df1.loc[:,'cancer_p1']=probability1\n\n    # ---\n\n\nLB : 0.59  (cv increase +0.02)\n    df = test_df0.merge(test_df1[['image_id','cancer_p1']],on='image_id',how='left')\n    df.loc[df.cancer_p1.isna(),'cancer_p1'] = df.cancer_p0\n    probability = (df.cancer_p0.values +  df.cancer_p1.values)/2\n\nnet0 and net1 are trained using same fold but different seed\n\n```\n\n![https://i.ibb.co/6szKVLc/Selection-613.png](https://i.ibb.co/6szKVLc/Selection-613.png)\n\n---\n\ntip:\n\nnet1 can also be a network that uses higher resolution, etc \n\n\n---\n[1]Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time\n\nuse larger learning rate to learn a coarse model.\nthen finetune using different seed (+ different hyperparameters, rate, weighing, etc)\n\nensemble all using the method  in [1], i.e. just average the weights of the best k-models in greedy way.\n",
      "votes": 13
    },
    {
      "id": 2096760,
      "postDate": "2023-01-12T08:43:06.620Z",
      "content": "<p>transformer is the king!</p>\n<p><a href=\"https://ibb.co/5FLzVqs\"><img src=\"https://i.ibb.co/sHqDrLs/Selection-516.png\" alt=\"Selection-516\"></a><br>\n<a href=\"https://ibb.co/8rTz5Wm\"><img src=\"https://i.ibb.co/McW8VYg/Selection-515.png\" alt=\"Selection-515\"></a></p>",
      "rawMarkdown": "transformer is the king!\n\n<a href=\"https://ibb.co/5FLzVqs\"><img src=\"https://i.ibb.co/sHqDrLs/Selection-516.png\" alt=\"Selection-516\" border=\"0\"></a>\n<a href=\"https://ibb.co/8rTz5Wm\"><img src=\"https://i.ibb.co/McW8VYg/Selection-515.png\" alt=\"Selection-515\" border=\"0\"></a>\n",
      "votes": 13,
      "replies": [
        {
          "id": 2096777,
          "postDate": "2023-01-12T08:56:26.153Z",
          "content": "<p>Havent heard about NextVIT thanks for sharing, I do not even find it in timm :)</p>\n<p>BTW I am surprised of your f1 score of 0.5 given that AUC is 0.9. </p>",
          "rawMarkdown": "Havent heard about NextVIT thanks for sharing, I do not even find it in timm :)\n\nBTW I am surprised of your f1 score of 0.5 given that AUC is 0.9. ",
          "replies": [
            {
              "id": 2096816,
              "postDate": "2023-01-12T09:20:57.397Z",
              "content": "<p>ROC-AUC is actually also not stable. you can get good F1 and AUC at CV by over sampling positive class and very strong model (e.g. imagenet top-1 0.86). But then i find that it is actually overfitting. </p>\n<p>for AUC of 0.90, F1 can varies a lot</p>",
              "rawMarkdown": "ROC-AUC is actually also not stable. you can get good F1 and AUC at CV by over sampling positive class and very strong model (e.g. imagenet top-1 0.86). But then i find that it is actually overfitting. \n\nfor AUC of 0.90, F1 can varies a lot",
              "votes": 1
            },
            {
              "id": 2096832,
              "postDate": "2023-01-12T09:31:40.157Z",
              "content": "<p>I see slight variation but not that big.</p>\n<p>What is ve class?</p>",
              "rawMarkdown": "I see slight variation but not that big.\n\nWhat is ve class?"
            },
            {
              "id": 2096835,
              "postDate": "2023-01-12T09:32:32.033Z",
              "content": "<p>it is positive class</p>",
              "rawMarkdown": "it is positive class"
            },
            {
              "id": 2097902,
              "postDate": "2023-01-13T03:44:37.150Z",
              "content": "<p></p>\n<p></p>\n<p></p>\n<p>manged to get tensorRT working!</p>\n<p>performance on local PC:</p>\n<pre><code>num of images process 10935\n\npytorch fp16\n-----\ntime = 20 min 26 sec\nauc =  0.8925856621368753\nf1score.max()  =  0.4968558969524153\n@threshold 0.3061224489795918\n\ntensorRT fp16\n-----\ntime =  9 min 05 sec\nauc  = 0.8926157748322697\nf1score.max() = 0.49423766814841186\n@threshold 0.3061224489795918\n</code></pre>\n<p>performance on kaggle notebook to come later …</p>",
              "rawMarkdown": "~~tensorRT is gpu specific~~\n\n~~unfortunately, if i use pytorch-tensorRT on kaggle notebook, it runs out of memory for my large input size when compile nn.Module to trt engine ....~~\n\n~~need to think of something else~~\n\nmanged to get tensorRT working!\n\nperformance on local PC:\n\n```\nnum of images process 10935\n\npytorch fp16\n-----\ntime = 20 min 26 sec\nauc =  0.8925856621368753\nf1score.max()  =  0.4968558969524153\n@threshold 0.3061224489795918\n \ntensorRT fp16\n-----\ntime =  9 min 05 sec\nauc  = 0.8926157748322697\nf1score.max() = 0.49423766814841186\n@threshold 0.3061224489795918\n```\n\nperformance on kaggle notebook to come later ...\n\n",
              "votes": 1
            },
            {
              "id": 2101298,
              "postDate": "2023-01-15T19:43:05.330Z",
              "content": "<p>If oversampling positive class will cause over fitting, may I ask how did you deal with the unbalance of neg/pos? BCE loss with weight? I read your discussion about multi-view. Your neg/pos is about 7:1. Thanks!</p>",
              "rawMarkdown": "If oversampling positive class will cause over fitting, may I ask how did you deal with the unbalance of neg/pos? BCE loss with weight? I read your discussion about multi-view. Your neg/pos is about 7:1. Thanks!"
            },
            {
              "id": 2108317,
              "postDate": "2023-01-20T12:28:38.563Z",
              "content": "<blockquote>\n  <p>But then i find that it is actually overfitting</p>\n</blockquote>\n<p>How did you find this out?</p>",
              "rawMarkdown": "> But then i find that it is actually overfitting\n\nHow did you find this out?"
            },
            {
              "id": 2108339,
              "postDate": "2023-01-20T12:57:08.803Z",
              "content": "<p>\"But then i find that it is actually overfitting\"<br>\nHow did you find this out?</p>\n<hr>\n<p>The curve below and the LB results<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/378521\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/378521</a></p>\n<hr>\n<p>let's do a thought experiment</p>\n<ol>\n<li>i train a model for very long iterations …. at the end it definitely overfits due to very long training.<br>\n2.at the begining it underfits.</li>\n<li>in the middle it is optimum. but i don't know where is it.</li>\n<li>you can use verify the optimum using validation set and LB hidden test dataset. But these are not relieable due to sample data size. but nevertheless, they are the \"best guess\"<br>\n5.if i plot the analytic curves for all the iterations,  i try to map observations of the curves to the generalisation of the model.</li>\n</ol>\n<p>you should at least note the following:</p>\n<ol>\n<li>if overfitted, the distuburion are sharp. in the extreme case, you see 2 delta function for pos and neg curve</li>\n<li>if overfitted, site1 and site2 a diverge. i,e,the model overfit part of the data and scrifice other data for better overall score</li>\n</ol>",
              "rawMarkdown": "\"But then i find that it is actually overfitting\"\nHow did you find this out?\n\n---\n\nThe curve below and the LB results\nhttps://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/378521\n\n---\n\nlet's do a thought experiment\n1. i train a model for very long iterations .... at the end it definitely overfits due to very long training.\n2.at the begining it underfits.\n3. in the middle it is optimum. but i don't know where is it.\n4. you can use verify the optimum using validation set and LB hidden test dataset. But these are not relieable due to sample data size. but nevertheless, they are the \"best guess\"\n5.if i plot the analytic curves for all the iterations,  i try to map observations of the curves to the generalisation of the model.\n\nyou should at least note the following:\n1. if overfitted, the distuburion are sharp. in the extreme case, you see 2 delta function for pos and neg curve\n2. if overfitted, site1 and site2 a diverge. i,e,the model overfit part of the data and scrifice other data for better overall score\n\n",
              "votes": 4
            },
            {
              "id": 2108347,
              "postDate": "2023-01-20T13:07:35.227Z",
              "content": "<p>Oh, I see, I get it, thanks!</p>",
              "rawMarkdown": "Oh, I see, I get it, thanks!"
            }
          ]
        },
        {
          "id": 2096785,
          "postDate": "2023-01-12T09:05:01.823Z",
          "content": "<p>CV of .497 👌! Is that cross-validation over how many folds? Thanks for the NextVIT architecture advice 👍</p>",
          "rawMarkdown": "CV of .497 👌! Is that cross-validation over how many folds? Thanks for the NextVIT architecture advice 👍",
          "replies": [
            {
              "id": 2096815,
              "postDate": "2023-01-12T09:17:43.723Z",
              "content": "<p>only one fold for CV and LB</p>",
              "rawMarkdown": "only one fold for CV and LB"
            },
            {
              "id": 2096837,
              "postDate": "2023-01-12T09:34:03.063Z",
              "content": "<p>okay that makes more sense then</p>",
              "rawMarkdown": "okay that makes more sense then"
            },
            {
              "id": 2096866,
              "postDate": "2023-01-12T09:56:08.937Z",
              "content": "<p>Alright thanks for info. <br>\nFor my training and testing the diff. in scores between folds and the sensitive threshold optimizing in numbers and math, give fear for a large shakeup. <br>\nHope you others have a more stable solutions and scores between the folds than I have ;)</p>",
              "rawMarkdown": "Alright thanks for info. \nFor my training and testing the diff. in scores between folds and the sensitive threshold optimizing in numbers and math, give fear for a large shakeup. \nHope you others have a more stable solutions and scores between the folds than I have ;)",
              "votes": 1
            },
            {
              "id": 2097060,
              "postDate": "2023-01-12T12:45:19.033Z",
              "content": "<p>one fold nextvit-b at 1536x960 already takes 9hr to run for the submission. <br>\nhence i am unable to run for an ensemble  of multiple folds.</p>\n<p>now i am solving this problem. (e.g. an early rejector, faster voi_lut_apply(), tensorRT or change a faster vision transformer).</p>\n<p>I also try other transformer like CoAT, PVTv2 and the results are generally good in CV (i haven't make submission for these yet)</p>",
              "rawMarkdown": "one fold nextvit-b at 1536x960 already takes 9hr to run for the submission. \nhence i am unable to run for an ensemble  of multiple folds.\n\nnow i am solving this problem. (e.g. an early rejector, faster voi\\_lut\\_apply(), tensorRT or change a faster vision transformer).\n\nI also try other transformer like CoAT, PVTv2 and the results are generally good in CV (i haven't make submission for these yet)"
            },
            {
              "id": 2098405,
              "postDate": "2023-01-13T14:18:21.227Z",
              "content": "<p>thanks for the info, how does base compare to the small nextvit? </p>",
              "rawMarkdown": "thanks for the info, how does base compare to the small nextvit? "
            }
          ]
        },
        {
          "id": 2097098,
          "postDate": "2023-01-12T13:20:04.460Z",
          "content": "<p>Thanks again for sharing!</p>\n<p>I am immediately trying out nextvit and I found that it is very difficult to train nextvit.<br>\nWith the same parameters as before, I had early gradient explosions, and when I reduced the learning rate, it converged but performance dropped.</p>\n<p>Do you have any good tips for training?</p>",
          "rawMarkdown": "Thanks again for sharing!\n\nI am immediately trying out nextvit and I found that it is very difficult to train nextvit.\nWith the same parameters as before, I had early gradient explosions, and when I reduced the learning rate, it converged but performance dropped.\n\nDo you have any good tips for training?",
          "replies": [
            {
              "id": 2097248,
              "postDate": "2023-01-12T14:37:58.990Z",
              "content": "<p>the parameters for training transformer (nextvit and others) are different from cnn<br>\nin general, learning rate and loss (oversampling or margin or +ve weighing) determines results</p>\n<p>i use the following:</p>\n<pre><code>image_height = 1536\nimage_width  = 960\n\npretain = '/home/titanx/hengck/share1/data/pretrain_model/nextvit_base_in1k_384.pth'\nnextvit_base()\nF.binary_cross_entropy_with_logits(cancer,batch['cancer'])\n\n\n    batch_size = 8 \n    ratio = 8 (1  pos sample in every 8 train sample)\n\n\n    def scheduler(epoch): \n\n        num_epoch = 6\n        start_lr  = 5e-5\n        min_lr    = 1e-5\n        lr = (num_epoch-epoch)/num_epoch * (start_lr-min_lr) + min_lr\n        lr = max(min_lr,lr)\n        return lr\n\n\n    optimizer = Lookahead(RAdam(filter(lambda p: p.requires_grad, net.parameters()),lr=-1), alpha=0.5, k=5)\n</code></pre>\n<p>train log (validation is without TTA)</p>\n<pre><code>** start training here! **\n   batch_size = 8,  ratio = 8\n   experiment = ['nextvit-b-1536', 'run_train_fold0.py']\n                           |-------------------------- VALID-------------------|---------------- TRAIN/BATCH --------\nrate     iter        epoch | loss   auc,   f1      th     sen    spec  f1 mean |  loss                | time         \n---------------------------------------------------------------------------------------------------------------------\n0.00e+0   00000000*   0.00 | 0.674  0.491  0.0437  0.490  0.539  0.481  0.043  | 0.000  0.000  0.000  |  0 hr 05 min\n4.33e-5   00006122*   1.00 | 0.194  0.759  0.2096  0.735  0.199  0.984  0.240  | 0.342  0.000  0.000  |  1 hr 27 min\n3.67e-5   00012244*   2.00 | 0.118  0.798  0.2516  0.531  0.249  0.984  0.349  | 0.271  0.000  0.000  |  2 hr 50 min\n3.00e-5   00018366*   3.00 | 0.091  0.815  0.3387  0.592  0.245  0.996  0.433  | 0.230  0.000  0.000  |  4 hr 13 min\n2.33e-5   00024488*   4.00 | 0.099  0.837  0.3718  0.796  0.278  0.995  0.465  | 0.179  0.000  0.000  |  5 hr 35 min\n1.67e-5   00030610*   5.00 | 0.102  0.834  0.3665  0.449  0.369  0.986  0.460  | 0.185  0.000  0.000  |  6 hr 58 min\n1.00e-5   00036732*   6.00 | 0.089  0.817  0.3350  0.122  0.320  0.987  0.452  | 0.166  0.000  0.000  |  8 hr 21 min\n1.00e-5   00042854*   7.00 | 0.094  0.819  0.3711  0.653  0.282  0.995  0.508  | 0.153  0.000  0.000  |  9 hr 44 min\n1.00e-5   00048976*   8.00 | 0.091  0.802  0.3829  0.163  0.307  0.993  0.473  | 0.154  0.000  0.000  | 11 hr 07 min\n</code></pre>\n<p>finally apply TTA and swa for</p>\n<pre><code>def make_swa():\n    out_file = fold_dir + f'/checkpoint/swa.model.pth' \n    iteration = [\n        '00048976',\n        '00042854',\n        '00036732',\n        '00036732',\n        '00030610',\n        '00024488',\n    ]\n    state_dict = None\n    for i in iteration:\n        f = fold_dir + f'/checkpoint/{i}.model.pth'\n        print(f)\n        f = torch.load(f, map_location=lambda storage, loc: storage)\n        if state_dict is None:\n            state_dict = f['state_dict']\n        else:\n            key = list(f['state_dict'].keys())\n            for k in key:\n                state_dict[k] = state_dict[k] + f['state_dict'][k]\n\n    for k in key:\n        state_dict[k] = state_dict[k] / len(iteration)\n    print('')\n\n    print(out_file)\n    torch.save({'state_dict': state_dict}, out_file)\n</code></pre>\n<p>cpu augmentation is too slow. so i use kornia gpu augmentation</p>\n<pre><code>class DataAugmentation1(nn.Module):\n    def __init__(self,):\n        super().__init__()\n        self.flip = nn.Sequential(\n            RandomHorizontalFlip(p=0.5),\n            RandomVerticalFlip(p=0.5),\n        )\n\n        p=0.8\n        self.transform_geometry = ImageSequential(\n            RandomAffine(degrees=20, translate=0.1, scale=[0.8,1.2], shear=20, p=p),\n            RandomThinPlateSpline(scale=0.25, p=p),\n            random_apply=1, #choose 1\n        )\n\n        p=0.5\n        self.transform_intensity = ImageSequential(\n            RandomGamma(gamma=(0.5, 1.5), gain=(0.5, 1.2), p=p),\n            RandomContrast(contrast=(0.8,1.2), p=p),\n            RandomBrightness(brightness=(0.8,1.2), p=p),\n            random_apply=1, #choose 1\n        )\n\n        p=0.5\n        self.transform_other = ImageSequential(\n            MyRoll(p=0.1), #Mosaic Augmentation using only one image, implemented by using pytorch roll , i.e. cyclic shift\n            MyCutOut(num_block=5, block_size=[0.1, 0.2], fill='constant', p=0.1),\n            random_apply=1, #choose 1\n        )\n\n\n    @torch.no_grad()  # disable gradients for effiency\n    def forward(self, x):\n        x = self.flip(x)  # BxCxHxW\n        x = self.transform_geometry(x)\n        x = self.transform_intensity(x)\n        x = self.transform_other(x)\n        return x\n</code></pre>",
              "rawMarkdown": "the parameters for training transformer (nextvit and others) are different from cnn\nin general, learning rate and loss (oversampling or margin or +ve weighing) determines results\n\ni use the following:\n\n\n```\nimage_height = 1536\nimage_width  = 960\n\npretain = '/home/titanx/hengck/share1/data/pretrain_model/nextvit_base_in1k_384.pth'\nnextvit_base()\nF.binary_cross_entropy_with_logits(cancer,batch['cancer'])\n\n\n\tbatch_size = 8 \n\tratio = 8 (1  pos sample in every 8 train sample)\n\n\n\tdef scheduler(epoch): \n\n\t\tnum_epoch = 6\n\t\tstart_lr  = 5e-5\n\t\tmin_lr    = 1e-5\n\t\tlr = (num_epoch-epoch)/num_epoch * (start_lr-min_lr) + min_lr\n\t\tlr = max(min_lr,lr)\n\t\treturn lr\n\n\n\toptimizer = Lookahead(RAdam(filter(lambda p: p.requires_grad, net.parameters()),lr=-1), alpha=0.5, k=5)\n\t\n```\n\ntrain log (validation is without TTA)\n\n```\n** start training here! **\n   batch_size = 8,  ratio = 8\n   experiment = ['nextvit-b-1536', 'run_train_fold0.py']\n                           |-------------------------- VALID-------------------|---------------- TRAIN/BATCH --------\nrate     iter        epoch | loss   auc,   f1      th     sen    spec  f1 mean |  loss                | time         \n---------------------------------------------------------------------------------------------------------------------\n0.00e+0   00000000*   0.00 | 0.674  0.491  0.0437  0.490  0.539  0.481  0.043  | 0.000  0.000  0.000  |  0 hr 05 min\n4.33e-5   00006122*   1.00 | 0.194  0.759  0.2096  0.735  0.199  0.984  0.240  | 0.342  0.000  0.000  |  1 hr 27 min\n3.67e-5   00012244*   2.00 | 0.118  0.798  0.2516  0.531  0.249  0.984  0.349  | 0.271  0.000  0.000  |  2 hr 50 min\n3.00e-5   00018366*   3.00 | 0.091  0.815  0.3387  0.592  0.245  0.996  0.433  | 0.230  0.000  0.000  |  4 hr 13 min\n2.33e-5   00024488*   4.00 | 0.099  0.837  0.3718  0.796  0.278  0.995  0.465  | 0.179  0.000  0.000  |  5 hr 35 min\n1.67e-5   00030610*   5.00 | 0.102  0.834  0.3665  0.449  0.369  0.986  0.460  | 0.185  0.000  0.000  |  6 hr 58 min\n1.00e-5   00036732*   6.00 | 0.089  0.817  0.3350  0.122  0.320  0.987  0.452  | 0.166  0.000  0.000  |  8 hr 21 min\n1.00e-5   00042854*   7.00 | 0.094  0.819  0.3711  0.653  0.282  0.995  0.508  | 0.153  0.000  0.000  |  9 hr 44 min\n1.00e-5   00048976*   8.00 | 0.091  0.802  0.3829  0.163  0.307  0.993  0.473  | 0.154  0.000  0.000  | 11 hr 07 min\n\n```\n\nfinally apply TTA and swa for\n\n```\n\n\ndef make_swa():\n\tout_file = fold_dir + f'/checkpoint/swa.model.pth' \n\titeration = [\n\t\t'00048976',\n\t\t'00042854',\n\t\t'00036732',\n\t\t'00036732',\n\t\t'00030610',\n\t\t'00024488',\n\t]\n\tstate_dict = None\n\tfor i in iteration:\n\t\tf = fold_dir + f'/checkpoint/{i}.model.pth'\n\t\tprint(f)\n\t\tf = torch.load(f, map_location=lambda storage, loc: storage)\n\t\tif state_dict is None:\n\t\t\tstate_dict = f['state_dict']\n\t\telse:\n\t\t\tkey = list(f['state_dict'].keys())\n\t\t\tfor k in key:\n\t\t\t\tstate_dict[k] = state_dict[k] + f['state_dict'][k]\n\n\tfor k in key:\n\t\tstate_dict[k] = state_dict[k] / len(iteration)\n\tprint('')\n\n\tprint(out_file)\n\ttorch.save({'state_dict': state_dict}, out_file)\n```\n\ncpu augmentation is too slow. so i use kornia gpu augmentation\n\n```\nclass DataAugmentation1(nn.Module):\n\tdef __init__(self,):\n\t\tsuper().__init__()\n\t\tself.flip = nn.Sequential(\n\t\t\tRandomHorizontalFlip(p=0.5),\n\t\t\tRandomVerticalFlip(p=0.5),\n\t\t)\n\n\t\tp=0.8\n\t\tself.transform_geometry = ImageSequential(\n\t\t\tRandomAffine(degrees=20, translate=0.1, scale=[0.8,1.2], shear=20, p=p),\n\t\t\tRandomThinPlateSpline(scale=0.25, p=p),\n\t\t\trandom_apply=1, #choose 1\n\t\t)\n\n\t\tp=0.5\n\t\tself.transform_intensity = ImageSequential(\n\t\t\tRandomGamma(gamma=(0.5, 1.5), gain=(0.5, 1.2), p=p),\n\t\t\tRandomContrast(contrast=(0.8,1.2), p=p),\n\t\t\tRandomBrightness(brightness=(0.8,1.2), p=p),\n\t\t\trandom_apply=1, #choose 1\n\t\t)\n\n\t\tp=0.5\n\t\tself.transform_other = ImageSequential(\n\t\t\tMyRoll(p=0.1), #Mosaic Augmentation using only one image, implemented by using pytorch roll , i.e. cyclic shift\n\t\t\tMyCutOut(num_block=5, block_size=[0.1, 0.2], fill='constant', p=0.1),\n\t\t\trandom_apply=1, #choose 1\n\t\t)\n\n\n\t@torch.no_grad()  # disable gradients for effiency\n\tdef forward(self, x):\n\t\tx = self.flip(x)  # BxCxHxW\n\t\tx = self.transform_geometry(x)\n\t\tx = self.transform_intensity(x)\n\t\tx = self.transform_other(x)\n\t\treturn x\n\n\n\n```\n",
              "votes": 13
            },
            {
              "id": 2097267,
              "postDate": "2023-01-12T14:47:56.330Z",
              "content": "<p>Thank you for being quite detailed!<br>\nIt's quite different from my setting, so I'm learning a lot.</p>",
              "rawMarkdown": "Thank you for being quite detailed!\nIt's quite different from my setting, so I'm learning a lot."
            },
            {
              "id": 2098082,
              "postDate": "2023-01-13T07:53:06.727Z",
              "content": "<p>can you tell what is f1 in the log above? is it non-thresholded pF1?</p>",
              "rawMarkdown": "can you tell what is f1 in the log above? is it non-thresholded pF1?"
            },
            {
              "id": 2098098,
              "postDate": "2023-01-13T08:16:50.987Z",
              "content": "<p>max threshold f1</p>",
              "rawMarkdown": "max threshold f1"
            },
            {
              "id": 2144080,
              "postDate": "2023-02-14T18:11:39.030Z",
              "content": "<p>Can you please explain why lr = -1 in optimizer?</p>",
              "rawMarkdown": "Can you please explain why lr = -1 in optimizer?",
              "votes": 1
            }
          ]
        },
        {
          "id": 2097365,
          "postDate": "2023-01-12T16:06:36.973Z",
          "content": "<p>Does SWA stands for  Stochastic Weight Averaging? <br>\nNice score!</p>",
          "rawMarkdown": "Does SWA stands for  Stochastic Weight Averaging? \nNice score!",
          "replies": [
            {
              "id": 2097370,
              "postDate": "2023-01-12T16:08:50.243Z",
              "content": "<p>OK. I see …. :) </p>",
              "rawMarkdown": "OK. I see .... :) "
            }
          ]
        },
        {
          "id": 2101305,
          "postDate": "2023-01-15T19:53:03.410Z",
          "content": "<p>Have you encountered any problem during training - loss NaN (I use oryginal naxtViT repo)? </p>",
          "rawMarkdown": "Have you encountered any problem during training - loss NaN (I use oryginal naxtViT repo)? ",
          "replies": [
            {
              "id": 2101474,
              "postDate": "2023-01-16T00:10:33.573Z",
              "content": "<p>maybe try use smaller learning rate. 5e-5 to 1e-5.</p>",
              "rawMarkdown": "maybe try use smaller learning rate. 5e-5 to 1e-5."
            },
            {
              "id": 2101811,
              "postDate": "2023-01-16T07:09:42.660Z",
              "content": "<p>yes, I started from 5e-5 but unfortunately exploded during second epoch. I will try today to do more experiments.</p>",
              "rawMarkdown": "yes, I started from 5e-5 but unfortunately exploded during second epoch. I will try today to do more experiments."
            },
            {
              "id": 2101847,
              "postDate": "2023-01-16T08:01:41.480Z",
              "content": "<p>increased pos sampling e.g. from 1 pos in batch=8 to 1 in 4.<br>\nuse 3e-5</p>",
              "rawMarkdown": "increased pos sampling e.g. from 1 pos in batch=8 to 1 in 4.\nuse 3e-5",
              "votes": 1
            },
            {
              "id": 2101954,
              "postDate": "2023-01-16T10:13:13.940Z",
              "content": "<p>I followed your suggestion (starting lr 3e-5) and no NaN appeared. Thank you so much.<br>\nOne more question - do you balance loss function using weight? As I can see my model is good after 1-2 epochs and then started to overfit for \"no cancer\". </p>",
              "rawMarkdown": "I followed your suggestion (starting lr 3e-5) and no NaN appeared. Thank you so much.\nOne more question - do you balance loss function using weight? As I can see my model is good after 1-2 epochs and then started to overfit for \"no cancer\". "
            },
            {
              "id": 2102072,
              "postDate": "2023-01-16T11:21:15.810Z",
              "content": "<p>Hi! I have the same question about the loss with balanced weight… Also, what's the good metric to decide a good model? AUC or f1? because in my eval, the highest AUC is around 0.975, which is the same proportion of neg/pos… </p>",
              "rawMarkdown": "Hi! I have the same question about the loss with balanced weight... Also, what's the good metric to decide a good model? AUC or f1? because in my eval, the highest AUC is around 0.975, which is the same proportion of neg/pos... "
            },
            {
              "id": 2102225,
              "postDate": "2023-01-16T13:31:04.297Z",
              "content": "<p>e.g.<br>\nset rate=5e-5:<br>\ncannot learn validation f1 is 0.05</p>\n<p>set rate=3e-5:<br>\nvalidation f1 is 0.10 for some first iterations, then fall back to previous case of 0.05 in later iterations</p>\n<p>set rate=1e-5:<br>\nsuccess! validation f1 improves as iterations proceeds</p>\n<hr>\n<p>if it doesn't work even if you set rate=1e-6, then the model cannot be train with you current setup.<br>\nyou have to change oversampling, loss (intermediate aux loss, or other loss than BCE) or use a less complex version (e.g. small, tiny version, etc)</p>",
              "rawMarkdown": "e.g.\nset rate=5e-5:\ncannot learn validation f1 is 0.05\n\nset rate=3e-5:\nvalidation f1 is 0.10 for some first iterations, then fall back to previous case of 0.05 in later iterations\n\nset rate=1e-5:\nsuccess! validation f1 improves as iterations proceeds\n\n---\n\nif it doesn't work even if you set rate=1e-6, then the model cannot be train with you current setup.\nyou have to change oversampling, loss (intermediate aux loss, or other loss than BCE) or use a less complex version (e.g. small, tiny version, etc)",
              "votes": 2
            },
            {
              "id": 2103973,
              "postDate": "2023-01-17T13:58:04.913Z",
              "content": "<p>My nextvit (small) is fighting …. 😂 AUC_ROC -&gt; 0.86 / probf1 ~0.36 (val)</p>\n<p><img src=\"https://i.ibb.co/QYfPK1c/W-B-Chart-17-01-2023-14-56-18.png\" alt=\"\"></p>\n<p><img src=\"https://i.ibb.co/4d39pWS/prec.png\" alt=\"\"><br>\n<img src=\"https://i.ibb.co/wMgP9NZ/sep.png\" alt=\"\"></p>",
              "rawMarkdown": "My nextvit (small) is fighting .... 😂 AUC_ROC -> 0.86 / probf1 ~0.36 (val)\n\n![](https://i.ibb.co/QYfPK1c/W-B-Chart-17-01-2023-14-56-18.png)\n\n![](https://i.ibb.co/4d39pWS/prec.png)\n![](https://i.ibb.co/wMgP9NZ/sep.png)"
            },
            {
              "id": 2104670,
              "postDate": "2023-01-18T00:37:04.637Z",
              "content": "<p>any submission results?</p>\n<p>there could be overfitting</p>\n<ol>\n<li>threshold values are high</li>\n<li>predicted pos distribution kinda of too steep</li>\n</ol>\n<p>but maybe LB results cab be good it is hard to judge.<br>\nyou can select a few intermediate model and submit too</p>",
              "rawMarkdown": "any submission results?\n\nthere could be overfitting\n1. threshold values are high\n2. predicted pos distribution kinda of too steep\n\nbut maybe LB results cab be good it is hard to judge.\nyou can select a few intermediate model and submit too\n"
            },
            {
              "id": 2104689,
              "postDate": "2023-01-18T01:00:05.280Z",
              "content": "<p>may I ask what is the metric to choose best model in this competition? AUC? pf1? f1?<br>\nBecause sometimes I found AUC is decreasing but the pf1 is increasing.<br>\nThanks for your answer!</p>",
              "rawMarkdown": "may I ask what is the metric to choose best model in this competition? AUC? pf1? f1?\nBecause sometimes I found AUC is decreasing but the pf1 is increasing.\nThanks for your answer!"
            },
            {
              "id": 2105173,
              "postDate": "2023-01-18T10:27:18.270Z",
              "content": "<p>Let me do some more experiment and will submit. I will let you know.</p>",
              "rawMarkdown": "Let me do some more experiment and will submit. I will let you know."
            }
          ]
        }
      ]
    },
    {
      "id": 2066638,
      "postDate": "2022-12-15T22:58:11.623Z",
      "content": "<p>it turns that i have lower LB than other kagglers using efficientnet.<br>\ni have forgotten to set the drop path rate. Here is the fixed:</p>\n<pre><code>efficientnet_b2(pretrained=True, drop_rate = 0.3, drop_path_rate = 0.2)\n\nrefer to timm efficientnet source code for settings of drop_rate, drop_path_rate\n</code></pre>\n<p>you can use single-fold model (i.e. just one checkpoint file) to get LB &gt;0.51. more on that later,</p>",
      "rawMarkdown": "it turns that i have lower LB than other kagglers using efficientnet.\ni have forgotten to set the drop path rate. Here is the fixed:\n\n```\n\nefficientnet_b2(pretrained=True, drop_rate = 0.3, drop_path_rate = 0.2)\n\nrefer to timm efficientnet source code for settings of drop_rate, drop_path_rate\n```\n\nyou can use single-fold model (i.e. just one checkpoint file) to get LB >0.51. more on that later,",
      "votes": 14
    },
    {
      "id": 2098821,
      "postDate": "2023-01-13T21:42:00.453Z",
      "content": "<p>tensorRT timming is out !!!</p>\n<p>as claimed in the paper, nextVIT is the fastest tensorRT vision transformer (same speed as efficientnet)</p>\n<pre><code>kaggle p100 notebook timing:\n\n--------------------------------------------------\npublic LB submission tensorRT 4 hr : LB 0.56\n\n--------------------------------------------------\nlocal cv 10939 images\n\nauc 0.8936061433377303\nf1score 0.49148140396595846\n@threshold 0.30612\n\n\ntotal (end-to-end from dashboard)\nDisk 16.4/73.1 GB\n1 hr 25 min\n\nbreakdown:\n\n1. install tensorRT, etc 5 min\n\n2. decode 10939 dicom images (keep aspect to 1539, use voi_lut-apply_32fp):\nnvjpeg2k (j2k, 5118 images) 28 min\ndicomsdl (non-j2k, 5917 images, 2 thread) 24 min\n\n3. detect breast box (resnet34 segentation) 2 min\n\n4. tensorRT fp16 nextVIT-B (1539x960)\none fold, original + hflip_TTA\n\nCPU utilisation 120%,  13/13 GB\nGPU utilisation 99% , 4.5/15 GB\n23 min 21 sec (7.80799 images per sec)\n\n\n=============================================\nreference (without tensorRT):\n\nsubmission  9hr : LB 0.56\n\n4. merged_bn fp16 (1539x960)\nCPU utilisation 108%,  13/13 GB\nGPU utilisation 100% , 8.5/15 GB\n95 min 32 sec (1.90819 images per sec)\n</code></pre>",
      "rawMarkdown": "tensorRT timming is out !!!\n\nas claimed in the paper, nextVIT is the fastest tensorRT vision transformer (same speed as efficientnet)\n\n```\nkaggle p100 notebook timing:\n\n--------------------------------------------------\npublic LB submission tensorRT 4 hr : LB 0.56\n\n--------------------------------------------------\nlocal cv 10939 images\n\nauc 0.8936061433377303\nf1score 0.49148140396595846\n@threshold 0.30612\n\n\ntotal (end-to-end from dashboard)\nDisk 16.4/73.1 GB\n1 hr 25 min\n\nbreakdown:\n\n1. install tensorRT, etc 5 min\n\n2. decode 10939 dicom images (keep aspect to 1539, use voi_lut-apply_32fp):\nnvjpeg2k (j2k, 5118 images) 28 min\ndicomsdl (non-j2k, 5917 images, 2 thread) 24 min\n\n3. detect breast box (resnet34 segentation) 2 min\n\n4. tensorRT fp16 nextVIT-B (1539x960)\none fold, original + hflip_TTA\n\nCPU utilisation 120%,  13/13 GB\nGPU utilisation 99% , 4.5/15 GB\n23 min 21 sec (7.80799 images per sec)\n\n\n=============================================\nreference (without tensorRT):\n\nsubmission  9hr : LB 0.56\n\n4. merged_bn fp16 (1539x960)\nCPU utilisation 108%,  13/13 GB\nGPU utilisation 100% , 8.5/15 GB\n95 min 32 sec (1.90819 images per sec)\n\n```",
      "votes": 12,
      "replies": [
        {
          "id": 2098826,
          "postDate": "2023-01-13T21:54:17.697Z",
          "content": "<p>How are you loading all images in 4 hours lol :)</p>\n<p>Thanks for sharing - transformer based architectures usually benefit the most from such compiles.</p>\n<p>I am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.</p>",
          "rawMarkdown": "How are you loading all images in 4 hours lol :)\n\nThanks for sharing - transformer based architectures usually benefit the most from such compiles.\n\nI am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.",
          "votes": 2,
          "replies": [
            {
              "id": 2098829,
              "postDate": "2023-01-13T21:57:31.520Z",
              "content": "<p>voi_lut_apply_32fp() eats my time. <br>\nwithout it loading images is 3hr.</p>\n<p>maybe i can improve a little by apply resize  first and then the voi lut porcessing on smaller resized image.</p>",
              "rawMarkdown": "voi\\_lut\\_apply\\_32fp() eats my time. \nwithout it loading images is 3hr.\n\nmaybe i can improve a little by apply resize  first and then the voi lut porcessing on smaller resized image."
            },
            {
              "id": 2098965,
              "postDate": "2023-01-14T01:42:01.293Z",
              "content": "<p>\"I am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.\"<br>\ni would think tensorRT is better</p>\n<p><img src=\"https://i.ibb.co/HhXp1j3/Selection-519.png\" alt=\"https://i.ibb.co/HhXp1j3/Selection-519.png\"><br>\n<a href=\"https://medium.com/mlearning-ai/how-does-pytorch-2-0-perform-in-inference-a-benchmark-with-tensorrt-and-onnx-runtime-fa1e59237f93\" target=\"_blank\">https://medium.com/mlearning-ai/how-does-pytorch-2-0-perform-in-inference-a-benchmark-with-tensorrt-and-onnx-runtime-fa1e59237f93</a></p>",
              "rawMarkdown": "\"I am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.\"\ni would think tensorRT is better\n\n![https://i.ibb.co/HhXp1j3/Selection-519.png](https://i.ibb.co/HhXp1j3/Selection-519.png)\nhttps://medium.com/mlearning-ai/how-does-pytorch-2-0-perform-in-inference-a-benchmark-with-tensorrt-and-onnx-runtime-fa1e59237f93"
            },
            {
              "id": 2099207,
              "postDate": "2023-01-14T08:56:41.320Z",
              "content": "<p>Yes I also saw this, but reality and graphs are sometimes different. SO Im just curious if someone tried.</p>",
              "rawMarkdown": "Yes I also saw this, but reality and graphs are sometimes different. SO Im just curious if someone tried.",
              "votes": 1
            }
          ]
        },
        {
          "id": 2098955,
          "postDate": "2023-01-14T01:25:21.517Z",
          "content": "<p>tensorRT engine trt file generation code is here:<br>\n<a href=\"https://www.kaggle.com/code/hengck23/4hr-tensorrt-nextvit-example\" target=\"_blank\">https://www.kaggle.com/code/hengck23/4hr-tensorrt-nextvit-example</a></p>\n<p>i think if you edit the code for 2x T4 GPU, you will get the same LB results in  1.5hr<br>\ntime to try a bigger 2048 image on transformer …</p>",
          "rawMarkdown": "tensorRT engine trt file generation code is here:\nhttps://www.kaggle.com/code/hengck23/4hr-tensorrt-nextvit-example\n\ni think if you edit the code for 2x T4 GPU, you will get the same LB results in ~~2hr~~ 1.5hr\ntime to try a bigger 2048 image on transformer ...",
          "votes": 2,
          "replies": [
            {
              "id": 2099506,
              "postDate": "2023-01-14T13:30:20.180Z",
              "content": "<p>2048x1280 for tensorrt NextVIT-S (smaller variant, imagenet 83.6) takes 5h.</p>\n<p>however, results were as good?<br>\nlocalCV 0.4856957958 <a href=\"https://www.kaggle.com/th\" target=\"_blank\">@th</a>=0.387755102<br>\nLB 0.46</p>",
              "rawMarkdown": "2048x1280 for tensorrt NextVIT-S (smaller variant, imagenet 83.6) takes 5h.\n\nhowever, results were as good?\nlocalCV 0.4856957958 @th=0.387755102\nLB 0.46"
            }
          ]
        },
        {
          "id": 2100620,
          "postDate": "2023-01-15T09:57:07.940Z",
          "rawMarkdown": "",
          "isDeleted": true,
          "replies": [
            {
              "id": 2100625,
              "postDate": "2023-01-15T10:01:23.500Z",
              "content": "<p>set dropout to 0. instead of 0<br>\none is float, the other is int</p>",
              "rawMarkdown": "set dropout to 0. instead of 0\none is float, the other is int"
            },
            {
              "id": 2100630,
              "postDate": "2023-01-15T10:07:28.927Z",
              "content": "<p>Many thanks! I'll try it.</p>",
              "rawMarkdown": "Many thanks! I'll try it."
            },
            {
              "id": 2100673,
              "postDate": "2023-01-15T10:52:17.483Z",
              "content": "<p>the error still exist after setting dropout to 0.  instead of 0</p>",
              "rawMarkdown": "the error still exist after setting dropout to 0.  instead of 0"
            },
            {
              "id": 2100676,
              "postDate": "2023-01-15T10:54:21.403Z",
              "content": "<p>can you post the full error message</p>",
              "rawMarkdown": "can you post the full error message"
            },
            {
              "id": 2100684,
              "postDate": "2023-01-15T11:00:51.820Z",
              "content": "<h2>this is full error message.</h2>\n<p>RuntimeError                              Traceback (most recent call last)<br>\n/tmp/ipykernel_23/1028975912.py in <br>\n     25         enabled_precisions={torch.half},  # Run with FP16<br>\n     26         workspace_size=1 &lt;&lt; 32,\n---&gt; 27         require_full_compilation=True,<br>\n     28     ) <br>\n     29     torch.jit.save(trt_model_fp16, 'kaggle-nextvit-b-1536-gpu-aug0-01-swa.trt_fp16.ts')</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch_tensorrt/_compile.py in compile(module, ir, inputs, enabled_precisions, **kwargs)<br>\n    122                 \"Module was provided as a torch.nn.Module, trying to script the module with torch.jit.script. In the event of a failure please preconvert your module to TorchScript\",<br>\n    123             )<br>\n--&gt; 124             ts_mod = torch.jit.script(module)<br>\n    125         return torch_tensorrt.ts.compile(<br>\n    126             ts_mod, inputs=inputs, enabled_precisions=enabled_precisions, **kwargs</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in script(obj, optimize, _frames_up, _rcb, example_inputs)<br>\n   1285         obj = call_prepare_scriptable_func(obj)<br>\n   1286         return torch.jit._recursive.create_script_module(<br>\n-&gt; 1287             obj, torch.jit._recursive.infer_methods_to_compile<br>\n   1288         )<br>\n   1289 </p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module(nn_module, stubs_fn, share_types, is_tracing)<br>\n    456     if not is_tracing:<br>\n    457         AttributeTypeIsSupportedChecker().check(nn_module)<br>\n--&gt; 458     return create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    459 <br>\n    460 def create_script_module_impl(nn_module, concrete_type, stubs_fn):</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    522     # Compile methods if necessary<br>\n    523     if concrete_type not in concrete_type_store.methods_compiled:<br>\n--&gt; 524         create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)<br>\n    525         # Create hooks after methods to ensure no name collisions between hooks and methods.<br>\n    526         # If done before, hooks can overshadow methods that aren't exported.</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)<br>\n    373     property_rcbs = [p.resolution_callback for p in property_stubs]<br>\n    374 <br>\n--&gt; 375     concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)<br>\n    376 <br>\n    377 def create_hooks_from_stubs(concrete_type, hook_stubs, pre_hook_stubs):</p>\n<p>RuntimeError: Can't redefine method: forward on class: <strong>torch</strong>.torch.nn.modules.dropout.Dropout (of Python compilation unit at: 0x5643bd433f20)</p>",
              "rawMarkdown": "this is full error message.\n---------------------------------------------------------------------------\nRuntimeError                              Traceback (most recent call last)\n/tmp/ipykernel_23/1028975912.py in <module>\n     25         enabled_precisions={torch.half},  # Run with FP16\n     26         workspace_size=1 << 32,\n---> 27         require_full_compilation=True,\n     28     ) \n     29     torch.jit.save(trt_model_fp16, 'kaggle-nextvit-b-1536-gpu-aug0-01-swa.trt_fp16.ts')\n\n/opt/conda/lib/python3.7/site-packages/torch_tensorrt/_compile.py in compile(module, ir, inputs, enabled_precisions, **kwargs)\n    122                 \"Module was provided as a torch.nn.Module, trying to script the module with torch.jit.script. In the event of a failure please preconvert your module to TorchScript\",\n    123             )\n--> 124             ts_mod = torch.jit.script(module)\n    125         return torch_tensorrt.ts.compile(\n    126             ts_mod, inputs=inputs, enabled_precisions=enabled_precisions, **kwargs\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in script(obj, optimize, _frames_up, _rcb, example_inputs)\n   1285         obj = call_prepare_scriptable_func(obj)\n   1286         return torch.jit._recursive.create_script_module(\n-> 1287             obj, torch.jit._recursive.infer_methods_to_compile\n   1288         )\n   1289 \n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module(nn_module, stubs_fn, share_types, is_tracing)\n    456     if not is_tracing:\n    457         AttributeTypeIsSupportedChecker().check(nn_module)\n--> 458     return create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    459 \n    460 def create_script_module_impl(nn_module, concrete_type, stubs_fn):\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    518 \n    519     # Actually create the ScriptModule, initializing it with the function we just defined\n--> 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)\n    521 \n    522     # Compile methods if necessary\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)\n    613             \"\"\"\n    614             script_module = RecursiveScriptModule(cpp_module)\n--> 615             init_fn(script_module)\n    616 \n    617             # Finalize the ScriptModule: replace the nn.Module state with our\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)\n    496             else:\n    497                 # always reuse the provided stubs_fn to infer the methods to compile\n--> 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)\n    499 \n    500             cpp_module.setattr(name, scripted)\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    518 \n    519     # Actually create the ScriptModule, initializing it with the function we just defined\n--> 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)\n    521 \n    522     # Compile methods if necessary\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)\n    613             \"\"\"\n    614             script_module = RecursiveScriptModule(cpp_module)\n--> 615             init_fn(script_module)\n    616 \n    617             # Finalize the ScriptModule: replace the nn.Module state with our\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)\n    496             else:\n    497                 # always reuse the provided stubs_fn to infer the methods to compile\n--> 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)\n    499 \n    500             cpp_module.setattr(name, scripted)\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    518 \n    519     # Actually create the ScriptModule, initializing it with the function we just defined\n--> 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)\n    521 \n    522     # Compile methods if necessary\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)\n    613             \"\"\"\n    614             script_module = RecursiveScriptModule(cpp_module)\n--> 615             init_fn(script_module)\n    616 \n    617             # Finalize the ScriptModule: replace the nn.Module state with our\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)\n    496             else:\n    497                 # always reuse the provided stubs_fn to infer the methods to compile\n--> 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)\n    499 \n    500             cpp_module.setattr(name, scripted)\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    518 \n    519     # Actually create the ScriptModule, initializing it with the function we just defined\n--> 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)\n    521 \n    522     # Compile methods if necessary\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)\n    613             \"\"\"\n    614             script_module = RecursiveScriptModule(cpp_module)\n--> 615             init_fn(script_module)\n    616 \n    617             # Finalize the ScriptModule: replace the nn.Module state with our\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)\n    496             else:\n    497                 # always reuse the provided stubs_fn to infer the methods to compile\n--> 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)\n    499 \n    500             cpp_module.setattr(name, scripted)\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    518 \n    519     # Actually create the ScriptModule, initializing it with the function we just defined\n--> 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)\n    521 \n    522     # Compile methods if necessary\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)\n    613             \"\"\"\n    614             script_module = RecursiveScriptModule(cpp_module)\n--> 615             init_fn(script_module)\n    616 \n    617             # Finalize the ScriptModule: replace the nn.Module state with our\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)\n    496             else:\n    497                 # always reuse the provided stubs_fn to infer the methods to compile\n--> 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)\n    499 \n    500             cpp_module.setattr(name, scripted)\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)\n    522     # Compile methods if necessary\n    523     if concrete_type not in concrete_type_store.methods_compiled:\n--> 524         create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)\n    525         # Create hooks after methods to ensure no name collisions between hooks and methods.\n    526         # If done before, hooks can overshadow methods that aren't exported.\n\n/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)\n    373     property_rcbs = [p.resolution_callback for p in property_stubs]\n    374 \n--> 375     concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)\n    376 \n    377 def create_hooks_from_stubs(concrete_type, hook_stubs, pre_hook_stubs):\n\nRuntimeError: Can't redefine method: forward on class: __torch__.torch.nn.modules.dropout.Dropout (of Python compilation unit at: 0x5643bd433f20)"
            },
            {
              "id": 2100711,
              "postDate": "2023-01-15T11:30:55.010Z",
              "content": "<p>this error don't occurs at my side. i also try  torch.jit.trace(model, x) which return successful results.<br>\ncheck that you are using eval()<br>\ni suggest the either of the followings:</p>\n<ol>\n<li><p>there are several versions of nextvit.py file from the github. i am using the image classification one.</p></li>\n<li><p>follow the instruction from the github (export_tensorrt_engine.py), try to create onnx file. This checks your system(version, etc), torch.onnx also calls torch jit script.</p></li>\n<li><p>simply edit your code. replace nn.Dropout with nn.Identity. If there is problem with dropPath create  afunction/class that just let input pass through. (dropout and droppath are not used in eval() mode) </p></li>\n</ol>",
              "rawMarkdown": "this error don't occurs at my side. i also try  torch.jit.trace(model, x) which return successful results.\ncheck that you are using eval()\ni suggest the either of the followings:\n\n1. there are several versions of nextvit.py file from the github. i am using the image classification one.\n\n2. follow the instruction from the github (export_tensorrt_engine.py), try to create onnx file. This checks your system(version, etc), torch.onnx also calls torch jit script.\n\n3. simply edit your code. replace nn.Dropout with nn.Identity. If there is problem with dropPath create  afunction/class that just let input pass through. (dropout and droppath are not used in eval() mode) "
            },
            {
              "id": 2100727,
              "postDate": "2023-01-15T11:48:57.480Z",
              "content": "<p>Thanks for your oppions.</p>",
              "rawMarkdown": "Thanks for your oppions."
            },
            {
              "id": 2100931,
              "postDate": "2023-01-15T13:56:41.310Z",
              "content": "<p>could you share a notebook for generating trt engine file of NextVitNet?</p>",
              "rawMarkdown": "could you share a notebook for generating trt engine file of NextVitNet?"
            }
          ]
        },
        {
          "id": 2100622,
          "postDate": "2023-01-15T10:01:06.630Z",
          "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8719748%2F3ceef46ac120c13cfdc04a3da3d8d84c%2F111.jpg?generation=1673776841164994&amp;alt=media\" alt=\"\"><br>\nhi, I got above error when generating trt engine file. Could you tell me how to solve it?</p>",
          "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8719748%2F3ceef46ac120c13cfdc04a3da3d8d84c%2F111.jpg?generation=1673776841164994&alt=media)\nhi, I got above error when generating trt engine file. Could you tell me how to solve it?"
        },
        {
          "id": 2104739,
          "postDate": "2023-01-18T02:18:19.333Z",
          "content": "<p>T4x2 is King, I just switched my pipeline to it, and preprocessing is x1.24 faster. Preprocessing the training set I improve from 3h 26m to 2h 46m !! </p>\n<p>processing the first 5118 j2k and 5917 non-j2k (to compare to your numbers), the pipeline does 9.2 minutes, and 20 minutes respectively! (time also includes yolov5 inference on 640px imgs)</p>\n<p>I get this small speedup by doing all the resizing and windowing operations in different threads on EACH GPU!</p>\n<p>just a note: the apply_voi_lut == apply_windowing since I believe that none of the images in the training set have a VOI lookup table. </p>",
          "rawMarkdown": "T4x2 is King, I just switched my pipeline to it, and preprocessing is x1.24 faster. Preprocessing the training set I improve from 3h 26m to 2h 46m !! \n\nprocessing the first 5118 j2k and 5917 non-j2k (to compare to your numbers), the pipeline does 9.2 minutes, and 20 minutes respectively! (time also includes yolov5 inference on 640px imgs)\n\nI get this small speedup by doing all the resizing and windowing operations in different threads on EACH GPU!\n\njust a note: the apply_voi_lut == apply_windowing since I believe that none of the images in the training set have a VOI lookup table. "
        }
      ]
    },
    {
      "id": 2107692,
      "postDate": "2023-01-20T01:01:26.237Z",
      "content": "<p>there is a novel method to fight rare (imbalance) class<br>\n[1] Background Splitting: Finding Rare Classes in a Sea of Background<br>\n<a href=\"https://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf\" target=\"_blank\">https://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf</a></p>\n<p>the idea i simple randomly assign label to your background images. hence even if you sample a batch of all negative images, you will not learn to predict same class<br>\n<a href=\"https://www.youtube.com/watch?v=I6-8mrp99sI\" target=\"_blank\">https://www.youtube.com/watch?v=I6-8mrp99sI</a></p>\n<p><img src=\"https://i.ibb.co/PQST7mG/Selection-594.png\" alt=\"https://i.ibb.co/PQST7mG/Selection-594.png\"></p>",
      "rawMarkdown": "there is a novel method to fight rare (imbalance) class\n[1] Background Splitting: Finding Rare Classes in a Sea of Background\nhttps://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf\n\nthe idea i simple randomly assign label to your background images. hence even if you sample a batch of all negative images, you will not learn to predict same class\nhttps://www.youtube.com/watch?v=I6-8mrp99sI\n\n![https://i.ibb.co/PQST7mG/Selection-594.png](https://i.ibb.co/PQST7mG/Selection-594.png)",
      "votes": 9,
      "replies": [
        {
          "id": 2108680,
          "postDate": "2023-01-20T18:16:23.110Z",
          "content": "<p>That's a cool idea. I'll be very curious to hear how well it works.</p>",
          "rawMarkdown": "That's a cool idea. I'll be very curious to hear how well it works.",
          "votes": 4
        }
      ]
    },
    {
      "id": 2076917,
      "postDate": "2022-12-27T02:37:49.950Z",
      "content": "<p>i find the treasure !!!!</p>\n<p><img src=\"https://i.ibb.co/6tGVML0/Selection-315.png\" alt=\"https://i.ibb.co/6tGVML0/Selection-315.png\"></p>",
      "rawMarkdown": "i find the treasure !!!!\n\n![https://i.ibb.co/6tGVML0/Selection-315.png](https://i.ibb.co/6tGVML0/Selection-315.png)\n\n",
      "votes": 10,
      "replies": [
        {
          "id": 2076959,
          "postDate": "2022-12-27T03:51:12.873Z",
          "content": "<p>A amazing AUC.</p>",
          "rawMarkdown": "A amazing AUC.",
          "votes": 1,
          "replies": [
            {
              "id": 2076990,
              "postDate": "2022-12-27T05:26:18.747Z",
              "content": "<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/</a></p>",
              "rawMarkdown": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/",
              "votes": 5
            },
            {
              "id": 2076997,
              "postDate": "2022-12-27T05:39:50.727Z",
              "content": "<p>Thanks you. </p>",
              "rawMarkdown": "Thanks you. "
            },
            {
              "id": 2076999,
              "postDate": "2022-12-27T05:45:35.963Z",
              "content": "<p>more baseline models and results later …</p>\n<p>MVCCL model for ADMANI dataset<br>\n<a href=\"https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset\" target=\"_blank\">https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset</a></p>",
              "rawMarkdown": "more baseline models and results later ...\n\nMVCCL model for ADMANI dataset\nhttps://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset",
              "votes": 4
            },
            {
              "id": 2077031,
              "postDate": "2022-12-27T06:41:00Z",
              "content": "<p>\"Our experiments were performed on Swinburne supercomputer OzSTAR* with a cluster of NVIDIA Tesla P100 GPUs\" .. OzSTAR comprises over 5,000 processing cores, 230 GPUs, a collective 25 Terabytes of system memory and access to over 6 Petabytes of storage.</p>",
              "rawMarkdown": "\"Our experiments were performed on Swinburne supercomputer OzSTAR* with a cluster of NVIDIA Tesla P100 GPUs\" .. OzSTAR comprises over 5,000 processing cores, 230 GPUs, a collective 25 Terabytes of system memory and access to over 6 Petabytes of storage."
            },
            {
              "id": 2077034,
              "postDate": "2022-12-27T06:46:26.990Z",
              "content": "<p>this is because they have 3 million images<br>\nthey resolution is about 2600</p>",
              "rawMarkdown": "this is because they have 3 million images\nthey resolution is about 2600"
            },
            {
              "id": 2077038,
              "postDate": "2022-12-27T06:52:07.653Z",
              "content": "<blockquote>\n  <p>this is because they have 3 million images<br>\n  they resolution is about 2600</p>\n</blockquote>\n<p>I am referring to the link <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/</a> </p>\n<p>This is the paper that the above screen cap came from.  Thanks Remek for the cite.</p>\n<p>I don't see any reference to 'millions' of images in the study.  Perhaps I missed it though.</p>",
              "rawMarkdown": "> this is because they have 3 million images\n> they resolution is about 2600\n\nI am referring to the link https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/ \n\nThis is the paper that the above screen cap came from.  Thanks Remek for the cite.\n\nI don't see any reference to 'millions' of images in the study.  Perhaps I missed it though."
            },
            {
              "id": 2077041,
              "postDate": "2022-12-27T06:57:08.987Z",
              "content": "<p><a href=\"https://www.kaggle.com/ynhuhu\" target=\"_blank\">@ynhuhu</a> Another thing to consider is that the AUC you see above is on the patches.  Here are the top line results from the paper:</p>\n<blockquote>\n  <p>Results<br>\n  Our evaluation uses the area under curve (AUC) and accuracy (ACC) for performance measurement. The best evaluation result, based on 349 test cases (930 test images), was an AUC of 0.8979 [95% confidence interval (CI) 0.873, 0.923] and ACC of 0.8178 [95% CI 0.785, 0.850]. </p>\n</blockquote>",
              "rawMarkdown": "@ynhuhu Another thing to consider is that the AUC you see above is on the patches.  Here are the top line results from the paper:\n\n\n>Results\nOur evaluation uses the area under curve (AUC) and accuracy (ACC) for performance measurement. The best evaluation result, based on 349 test cases (930 test images), was an AUC of 0.8979 [95% confidence interval (CI) 0.873, 0.923] and ACC of 0.8178 [95% CI 0.785, 0.850]. \n",
              "votes": 1
            },
            {
              "id": 2077053,
              "postDate": "2022-12-27T07:09:24.097Z",
              "content": "<p>Ye, you are right. </p>",
              "rawMarkdown": "Ye, you are right. "
            }
          ]
        }
      ]
    },
    {
      "id": 2069441,
      "postDate": "2022-12-19T01:53:45.930Z",
      "content": "<p><img src=\"https://i.ibb.co/jGmX2RS/Selection-228.png\" alt=\"https://i.ibb.co/jGmX2RS/Selection-228.png\"></p>\n<p>in some of the video and websites i have read, we screen  mammography images by comparing left and right images side-by-side (see image above). Instead of predicting based on single image, we use stitch of of R-L image as single input. Alternatively, we can have 2 view (2x single input) and fused them later.</p>\n<p>The advantage is that we both have same breast density, so abnormality can stand out better</p>",
      "rawMarkdown": "![https://i.ibb.co/jGmX2RS/Selection-228.png](https://i.ibb.co/jGmX2RS/Selection-228.png)\n\nin some of the video and websites i have read, we screen  mammography images by comparing left and right images side-by-side (see image above). Instead of predicting based on single image, we use stitch of of R-L image as single input. Alternatively, we can have 2 view (2x single input) and fused them later.\n\nThe advantage is that we both have same breast density, so abnormality can stand out better",
      "votes": 9,
      "replies": [
        {
          "id": 2069467,
          "postDate": "2022-12-19T02:32:32.970Z",
          "rawMarkdown": "",
          "votes": -10,
          "isDeleted": true
        }
      ]
    },
    {
      "id": 2061348,
      "postDate": "2022-12-11T03:12:28.180Z",
      "content": "<p>i see some (very) good improvement in using 16-bit png (instead of 8bit).<br>\nThis is because i am not applying windowing or VOI LUT in the dim data, which itself is tricky.</p>\n<p>It is difficult to large scale experiment (especially for kaggle submission)<br>\nOther kagglers may want to verify this.</p>\n<pre><code>def read_dicom_as_image(dcm_file):\n    dicom = pydicom.dcmread(dcm_file)\n    image = dicom.pixel_array  \n    image = (image - image.min()) / (image.max() - image.min()+1e-6)  #this cast to float32\n    if dicom.PhotometricInterpretation == 'MONOCHROME1':\n        image = 1 - image\n\n    return image\n\ndef parallel_process(dcm_file):\n    patient_id = dcm_file.split('/')[-2]\n    image_id   = dcm_file.split('/')[-1][:-4]\n    image = read_dicom_as_image(dcm_file)\n    image = cv2.resize(image, (image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    image = (image * 65535).astype(np.uint16)\n\n    os.makedirs(f'{png_dir}/{patient_id}', exist_ok=True)\n    cv2.imwrite(f'{png_dir}/{patient_id}/{image_id}.png',image)\n\n\nif 1:\n    Parallel(n_jobs=10)(\n        delayed(parallel_process)(f)\n        for f in tqdm(dcm_file)\n    )\n</code></pre>\n<p>i suspect my previous improvement of 2048 is actually from the intensity improvement</p>\n<hr>\n<p>learnable windowing<br>\nPractical Window Setting Optimization for Medical Image Deep Learning<br>\n<a href=\"https://github.com/MGH-LMIC/windows_optimization\" target=\"_blank\">https://github.com/MGH-LMIC/windows_optimization</a></p>\n<p>CT Window Trainable Neural Network for Improving Intracranial Hemorrhage Detection<br>\n<a href=\"https://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg\" target=\"_blank\">https://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg</a></p>",
      "rawMarkdown": "i see some (very) good improvement in using 16-bit png (instead of 8bit).\nThis is because i am not applying windowing or VOI LUT in the dim data, which itself is tricky.\n\nIt is difficult to large scale experiment (especially for kaggle submission)\nOther kagglers may want to verify this.\n\n```\ndef read_dicom_as_image(dcm_file):\n    dicom = pydicom.dcmread(dcm_file)\n    image = dicom.pixel_array  \n    image = (image - image.min()) / (image.max() - image.min()+1e-6)  #this cast to float32\n    if dicom.PhotometricInterpretation == 'MONOCHROME1':\n        image = 1 - image\n\n    return image\n\ndef parallel_process(dcm_file):\n    patient_id = dcm_file.split('/')[-2]\n    image_id   = dcm_file.split('/')[-1][:-4]\n    image = read_dicom_as_image(dcm_file)\n    image = cv2.resize(image, (image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    image = (image * 65535).astype(np.uint16)\n\n    os.makedirs(f'{png_dir}/{patient_id}', exist_ok=True)\n    cv2.imwrite(f'{png_dir}/{patient_id}/{image_id}.png',image)\n\n\nif 1:\n    Parallel(n_jobs=10)(\n        delayed(parallel_process)(f)\n        for f in tqdm(dcm_file)\n    )\n\n\n```\n\ni suspect my previous improvement of 2048 is actually from the intensity improvement\n\n\n--- \nlearnable windowing\nPractical Window Setting Optimization for Medical Image Deep Learning\nhttps://github.com/MGH-LMIC/windows_optimization\n\n\nCT Window Trainable Neural Network for Improving Intracranial Hemorrhage Detection\nhttps://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg",
      "votes": 10,
      "replies": [
        {
          "id": 2062154,
          "postDate": "2022-12-11T19:29:27.940Z",
          "content": "<p>I'm not sure how you saved <strong>2048 x 2048</strong> <code>uint16</code> images. Cuz, only <code>13k</code> images take <code>&gt;20GB</code> space, so for total data, it would be nearly <code>&gt;100GB</code> space. In that case, kaggle should throw error. Could you please share how you saved <code>uint16</code> images?</p>",
          "rawMarkdown": "I'm not sure how you saved **2048 x 2048** `uint16` images. Cuz, only `13k` images take `>20GB` space, so for total data, it would be nearly `>100GB` space. In that case, kaggle should throw error. Could you please share how you saved `uint16` images?"
        },
        {
          "id": 2062195,
          "postDate": "2022-12-11T20:41:29.267Z",
          "content": "<p>You could do it off kaggle, right.  Also, batching on kaggle for inference.</p>",
          "rawMarkdown": "You could do it off kaggle, right.  Also, batching on kaggle for inference."
        },
        {
          "id": 2062268,
          "postDate": "2022-12-11T23:11:24.313Z",
          "content": "<p>i do not save at kaggle inference.<br>\ni haven't tried uint16 for 2048 yet. i am running experiments for 1024 for now</p>",
          "rawMarkdown": "i do not save at kaggle inference.\ni haven't tried uint16 for 2048 yet. i am running experiments for 1024 for now"
        },
        {
          "id": 2063994,
          "postDate": "2022-12-13T13:01:58.047Z",
          "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> Why it's for?</p>\n<pre><code>image = (image * 65535).astype(np.uint16)\n</code></pre>",
          "rawMarkdown": "@hengck23 Why it's for?\n\n```\nimage = (image * 65535).astype(np.uint16)\n```"
        },
        {
          "id": 2064160,
          "postDate": "2022-12-13T14:58:37.117Z",
          "content": "<p>Seems like image is normalized normalized beforehand (usually between 0-1), to cast uint16 you better to multiply these values by 65535 (which is the max value of uint16) before mapping them to rounded uint16 values.</p>",
          "rawMarkdown": "Seems like image is normalized normalized beforehand (usually between 0-1), to cast uint16 you better to multiply these values by 65535 (which is the max value of uint16) before mapping them to rounded uint16 values."
        },
        {
          "id": 2064198,
          "postDate": "2022-12-13T15:15:34.003Z",
          "content": "<p>this is to save as 16-bit png.<br>\nif you don't save image for inference, the casting is not required</p>\n<p><img src=\"https://i.ibb.co/JdV5v8Y/Selection-174.png\" alt=\"https://i.ibb.co/JdV5v8Y/Selection-174.png\"></p>",
          "rawMarkdown": "this is to save as 16-bit png.\nif you don't save image for inference, the casting is not required\n\n![https://i.ibb.co/JdV5v8Y/Selection-174.png](https://i.ibb.co/JdV5v8Y/Selection-174.png)",
          "votes": 8,
          "replies": [
            {
              "id": 2079543,
              "postDate": "2022-12-29T12:09:59.593Z",
              "content": "<p>What do you think about normalizing with 16-bit dataset mean/std? <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> </p>",
              "rawMarkdown": "What do you think about normalizing with 16-bit dataset mean/std? @hengck23 "
            },
            {
              "id": 2094504,
              "postDate": "2023-01-10T19:37:10.733Z",
              "content": "<p>only experiment will confirms results.<br>\nand you don't have to stick to one processing. you can use different processing in ensemble</p>",
              "rawMarkdown": "only experiment will confirms results.\nand you don't have to stick to one processing. you can use different processing in ensemble\n\n\n"
            }
          ]
        },
        {
          "id": 2094071,
          "postDate": "2023-01-10T15:48:04.460Z",
          "content": "<p>This is interesting. If you don't convert to 8bit, you have more information available. But do you still start from the pretrained models on 8 bit images?</p>",
          "rawMarkdown": "This is interesting. If you don't convert to 8bit, you have more information available. But do you still start from the pretrained models on 8 bit images?",
          "replies": [
            {
              "id": 2094506,
              "postDate": "2023-01-10T19:38:04.793Z",
              "content": "<p>no.</p>\n<p>it is like if pretrain model is train on 224x224 image size, you can finetune it for larger and smaller size</p>",
              "rawMarkdown": "no.\n\nit is like if pretrain model is train on 224x224 image size, you can finetune it for larger and smaller size",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2067573,
      "postDate": "2022-12-16T20:53:11.017Z",
      "content": "<p>the fastest you can go is slightly less than 3hr<br>\ninput1024, one model single-fold efficientnetb4</p>\n<p><img src=\"https://i.ibb.co/x5DN900/Selection-206.png\" alt=\"https://i.ibb.co/x5DN900/Selection-206.png\"></p>\n<pre><code>#share ----\ndef normalised_to_8bit(image, photometric_interpretation):\n    xmin = image.min()\n    xmax = image.max() \n    norm = np.empty_like(image, dtype=np.uint8)\n    dicomsdl.util.convert_to_uint8(image, norm, xmin, xmax)\n    if photometric_interpretation == 'MONOCHROME1':\n        norm = 255 - norm\n    return norm\n\n\n# j2k ----\nj2k_decoder = nvjpeg2k.Decoder()\ndef process_j2k(df, dcm_dir, image_dir, image_size):\n    for t, d in tqdm(df.iterrows()):\n        dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n        ds = pydicom.dcmread(dcm_file)\n        offset = ds.PixelData.find(b'\\x00\\x00\\x00\\x0C')\n        jpeg_stream = bytearray(ds.PixelData[offset:]) \n        m = j2k_decoder.decode(jpeg_stream) \n\n\n        # resize and save as png\n        m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n        m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n        cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\n...\n\n#non j2k ----\n\ndef dicomsdl_parallel_process_fn(d, dcm_dir, image_dir, image_size):\n    dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n    ds = dicomsdl.open(dcm_file)\n    info = ds.getPixelDataInfo() \n    m = np.empty(shape=[info['Rows'], info['Cols']], dtype=info['dtype'])\n    ds.copyFrameData(0, m) \n\n    # resize and save as png\n    m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n    m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\ndef process_non_j2k(df, dcm_dir, image_dir, image_size, n_jobs):  \n    Parallel(n_jobs=n_jobs)(\n        delayed(dicomsdl_parallel_process_fn)(d, dcm_dir, image_dir, image_size)\n        for t,d in tqdm(df.iterrows())\n    )\n</code></pre>\n<p>you probably need to retrain with images generated by dicomsdl.util.convert_to_uint8()</p>",
      "rawMarkdown": "the fastest you can go is slightly less than 3hr\ninput1024, one model single-fold efficientnetb4\n\n![https://i.ibb.co/x5DN900/Selection-206.png](https://i.ibb.co/x5DN900/Selection-206.png)\n \n```\n#share ----\ndef normalised_to_8bit(image, photometric_interpretation):\n    xmin = image.min()\n    xmax = image.max() \n    norm = np.empty_like(image, dtype=np.uint8)\n    dicomsdl.util.convert_to_uint8(image, norm, xmin, xmax)\n    if photometric_interpretation == 'MONOCHROME1':\n        norm = 255 - norm\n    return norm\n\n\n# j2k ----\nj2k_decoder = nvjpeg2k.Decoder()\ndef process_j2k(df, dcm_dir, image_dir, image_size):\n    for t, d in tqdm(df.iterrows()):\n        dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n        ds = pydicom.dcmread(dcm_file)\n        offset = ds.PixelData.find(b'\\x00\\x00\\x00\\x0C')\n        jpeg_stream = bytearray(ds.PixelData[offset:]) \n        m = j2k_decoder.decode(jpeg_stream) \n\n\n        # resize and save as png\n        m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n        m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n        cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\n...\n\n#non j2k ----\n \ndef dicomsdl_parallel_process_fn(d, dcm_dir, image_dir, image_size):\n    dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n    ds = dicomsdl.open(dcm_file)\n    info = ds.getPixelDataInfo() \n    m = np.empty(shape=[info['Rows'], info['Cols']], dtype=info['dtype'])\n    ds.copyFrameData(0, m) \n\n    # resize and save as png\n    m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n    m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\ndef process_non_j2k(df, dcm_dir, image_dir, image_size, n_jobs):  \n    Parallel(n_jobs=n_jobs)(\n        delayed(dicomsdl_parallel_process_fn)(d, dcm_dir, image_dir, image_size)\n        for t,d in tqdm(df.iterrows())\n    )\n\n```\n\nyou probably need to retrain with images generated by dicomsdl.util.convert_to_uint8()\n\n \n\n\n",
      "votes": 8,
      "replies": [
        {
          "id": 2082166,
          "postDate": "2023-01-01T07:37:53.707Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 2067719,
      "postDate": "2022-12-17T04:28:46.743Z",
      "content": "<p>in theory, you can stitch four 1024 images (LCC,RCC,LMLO,RMLO) into a single 2048 image. Then input this into a single network and make 2 predictions for L,R</p>",
      "rawMarkdown": "in theory, you can stitch four 1024 images (LCC,RCC,LMLO,RMLO) into a single 2048 image. Then input this into a single network and make 2 predictions for L,R",
      "votes": 7,
      "replies": [
        {
          "id": 2079570,
          "postDate": "2022-12-29T12:34:48.603Z",
          "content": "<p>Multiple-instance learning could be useful.</p>",
          "rawMarkdown": "Multiple-instance learning could be useful."
        }
      ]
    },
    {
      "id": 2059408,
      "postDate": "2022-12-08T20:15:54.477Z",
      "content": "<p>[paper] Deep Neural Networks Improve Radiologists’ Performance in Breast Cancer Screening- Nan Wu<br>\n<a href=\"https://github.com/nyukat/breast_cancer_classifier\" target=\"_blank\">https://github.com/nyukat/breast_cancer_classifier</a></p>\n<p>extensive experiments for multi-view prediction (over 1 million images)</p>\n<p><a href=\"https://ibb.co/QQpjs9P\"><img src=\"https://i.ibb.co/sRbJLjK/Selection-142.png\" alt=\"Selection-142\"></a><br>\n<a href=\"https://ibb.co/bJNN6YT\"><img src=\"https://i.ibb.co/M6PPgKr/Selection-141.png\" alt=\"Selection-141\"></a></p>",
      "rawMarkdown": "[paper] Deep Neural Networks Improve Radiologists’ Performance in Breast Cancer Screening- Nan Wu\nhttps://github.com/nyukat/breast_cancer_classifier\n\nextensive experiments for multi-view prediction (over 1 million images)\n\n<a href=\"https://ibb.co/QQpjs9P\"><img src=\"https://i.ibb.co/sRbJLjK/Selection-142.png\" alt=\"Selection-142\" border=\"0\"></a>\n<a href=\"https://ibb.co/bJNN6YT\"><img src=\"https://i.ibb.co/M6PPgKr/Selection-141.png\" alt=\"Selection-141\" border=\"0\"></a>",
      "votes": 7,
      "replies": [
        {
          "id": 2059420,
          "postDate": "2022-12-08T20:27:19.103Z",
          "content": "<p>Very nice concept. Good inspiration! 👍</p>",
          "rawMarkdown": "Very nice concept. Good inspiration! 👍"
        }
      ]
    },
    {
      "id": 2120459,
      "postDate": "2023-01-29T16:00:55.473Z",
      "content": "<p>i tried many multiple images prediction method and below is the only one that works.<br>\nFor nextvit-B local CV improves from 0.49 (single-image predict + mean) to 0.511 (multi-image predict) for the my first experiments:</p>\n<ol>\n<li>i used frozen nextvit-B image encoder (in future i would use finetune)</li>\n<li>i use only channel feature after global pool from image encoder (in future I can use local feature, i.e. feature at each x,y location)</li>\n<li>i did not use augmentation in multi-images training yet</li>\n</ol>\n<p>I got improvement at the first run without adjusting of hyper parameters and pipeline! </p>\n<hr>\n<p>here are more information:<br>\nPART ONE: paper review and description of method</p>\n<p><img src=\"https://i.ibb.co/yy8bBGd/Selection-724.png\" alt=\"https://i.ibb.co/yy8bBGd/Selection-724.png\"></p>\n<p>[1] COVID-19 Prognosis via Self-Supervised Representation Learning and Multi-Image Prediction - A. Sriram (facebook AI),  arXiv 2020<br>\n<a href=\"https://github.com/facebookresearch/CovidPrognosis\" target=\"_blank\">https://github.com/facebookresearch/CovidPrognosis</a></p>\n<p>PART TWO: modification for kaggle breast mammography and example notebook<br>\ndummy code is up: <a href=\"https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction\" target=\"_blank\">https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction</a></p>\n<p>PART THREE: results and analysis<br>\nto be updated</p>",
      "rawMarkdown": "i tried many multiple images prediction method and below is the only one that works.\nFor nextvit-B local CV improves from 0.49 (single-image predict + mean) to 0.511 (multi-image predict) for the my first experiments:\n1. i used frozen nextvit-B image encoder (in future i would use finetune)\n2. i use only channel feature after global pool from image encoder (in future I can use local feature, i.e. feature at each x,y location)\n3. i did not use augmentation in multi-images training yet\n\nI got improvement at the first run without adjusting of hyper parameters and pipeline! \n\n----\n\nhere are more information:\nPART ONE: paper review and description of method\n\n![https://i.ibb.co/yy8bBGd/Selection-724.png] (https://i.ibb.co/yy8bBGd/Selection-724.png)\n\n[1] COVID-19 Prognosis via Self-Supervised Representation Learning and Multi-Image Prediction - A. Sriram (facebook AI),  arXiv 2020\nhttps://github.com/facebookresearch/CovidPrognosis\n\n\nPART TWO: modification for kaggle breast mammography and example notebook\ndummy code is up: https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction\n\n\nPART THREE: results and analysis\nto be updated",
      "votes": 5,
      "replies": [
        {
          "id": 2120521,
          "postDate": "2023-01-29T16:50:56.257Z",
          "content": "<p>first experiment results</p>\n<pre><code>MIP prediction\n\nget_f1score(cancer_p[site_id==1], cancer_t[site_id==1], mode='max')\nOut[10]: (0.4852269914108315, 0.4081632653061224) # (f1score, threshold)\n\nget_f1score(cancer_p[site_id==2], cancer_t[site_id==2], mode='max')\nOut[11]: (0.5681399603886713, 0.24489795918367346)\n\nget_f1score(cancer_p, cancer_t, mode='max')\nOut[12]: (0.5106197826424658, 0.2857142857142857)\nauc = 0.8344857204208718\nbce loss =  0.081253260\n</code></pre>",
          "rawMarkdown": "first experiment results\n```\nMIP prediction\n\nget_f1score(cancer_p[site_id==1], cancer_t[site_id==1], mode='max')\nOut[10]: (0.4852269914108315, 0.4081632653061224) # (f1score, threshold)\n\nget_f1score(cancer_p[site_id==2], cancer_t[site_id==2], mode='max')\nOut[11]: (0.5681399603886713, 0.24489795918367346)\n\nget_f1score(cancer_p, cancer_t, mode='max')\nOut[12]: (0.5106197826424658, 0.2857142857142857)\nauc = 0.8344857204208718\nbce loss =  0.081253260\n\n```",
          "votes": 1,
          "replies": [
            {
              "id": 2120913,
              "postDate": "2023-01-29T22:45:47.763Z",
              "content": "<p><img src=\"https://i.ibb.co/yQ9KQdz/Selection-728.png\" alt=\"https://i.ibb.co/yQ9KQdz/Selection-728.png\"></p>",
              "rawMarkdown": "![https://i.ibb.co/yQ9KQdz/Selection-728.png](https://i.ibb.co/yQ9KQdz/Selection-728.png)",
              "votes": 1
            },
            {
              "id": 2121485,
              "postDate": "2023-01-30T10:53:34.930Z",
              "content": "<p>MIP trained with frozen image encoder + augmentation<br>\nuse age, site id, view<br>\n<img src=\"https://i.ibb.co/wWtMJsQ/Selection-739.png\" alt=\"https://i.ibb.co/wWtMJsQ/Selection-739.png\"></p>\n<p><br>\nunfrozen image encoder (last layer only) + augmentation :  worse (overfitting observed)</p>\n<p>unfrozen image encoder (last layer only) + no augmentation :  not that bad??? … to repeat experiment again</p>",
              "rawMarkdown": "MIP trained with frozen image encoder + augmentation\nuse age, site id, view\n![https://i.ibb.co/wWtMJsQ/Selection-739.png](https://i.ibb.co/wWtMJsQ/Selection-739.png)\n\n~~next update is to trained with unfrozen image encoder~~\nunfrozen image encoder (last layer only) + augmentation :  worse (overfitting observed)\n\n\nunfrozen image encoder (last layer only) + no augmentation :  not that bad??? ... to repeat experiment again",
              "votes": 2
            },
            {
              "id": 2123664,
              "postDate": "2023-01-31T16:19:21.270Z",
              "content": "<p>Looks really good! Any sub to LB?<br>\nIt appeared that my bug in code had no influence on score. Still one model only 0.57. Looking for new ways to cross over 0.6 😂</p>",
              "rawMarkdown": "Looks really good! Any sub to LB?\nIt appeared that my bug in code had no influence on score. Still one model only 0.57. Looking for new ways to cross over 0.6 😂"
            },
            {
              "id": 2123956,
              "postDate": "2023-01-31T18:58:40.430Z",
              "content": "<p>Hello <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> Could you tell me which image size did you use to get 0.57 LB? Thanks</p>",
              "rawMarkdown": "Hello @remekkinas Could you tell me which image size did you use to get 0.57 LB? Thanks"
            },
            {
              "id": 2123989,
              "postDate": "2023-01-31T19:24:57.640Z",
              "content": "<p>From beggining of the competiton I use rule (SIZE, SIZE // 2). Size depends on network architecture I use. Now is (4 * 384, 2 * 384). </p>",
              "rawMarkdown": "From beggining of the competiton I use rule (SIZE, SIZE // 2). Size depends on network architecture I use. Now is (4 * 384, 2 * 384). "
            },
            {
              "id": 2138174,
              "postDate": "2023-02-10T16:06:57.800Z",
              "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> did you ever submit this model to LB?</p>",
              "rawMarkdown": "@hengck23 did you ever submit this model to LB?"
            },
            {
              "id": 2145791,
              "postDate": "2023-02-15T11:12:01.113Z",
              "content": "<p>yes i did. surprsingly ….  +0.03 in CV, -0.01 in LB </p>",
              "rawMarkdown": "yes i did. surprsingly ....  +0.03 in CV, -0.01 in LB ",
              "votes": 1
            },
            {
              "id": 2146126,
              "postDate": "2023-02-15T16:16:50.693Z",
              "content": "<p>I had LB … CV correlation. The worse score in CV the best on LB. This is certainly joke but I am really afraid how to chose final submission. I know that my submissions are shaky… and do not count on anything. </p>",
              "rawMarkdown": "I had LB … CV correlation. The worse score in CV the best on LB. This is certainly joke but I am really afraid how to chose final submission. I know that my submissions are shaky… and do not count on anything. ",
              "votes": 4
            },
            {
              "id": 2146231,
              "postDate": "2023-02-15T17:55:37.040Z",
              "content": "<p>Our first 2 folds tracked public LB very closely so occassionally I would submit 2 folds' predictions to pump our public position 😂. Also, multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds, which ended up in worse LB scores</p>",
              "rawMarkdown": "Our first 2 folds tracked public LB very closely so occassionally I would submit 2 folds' predictions to pump our public position 😂. Also, multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds, which ended up in worse LB scores",
              "votes": 5
            },
            {
              "id": 2146426,
              "postDate": "2023-02-15T21:21:39.920Z",
              "content": "<p>\"multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds\"</p>\n<p>higher threshold is over fitting i i i think <br>\nit seems that there is not enough data to do multiview prediction, it is quite a pity.</p>\n<p>i have to remove transformer and adopted simpler fusion like mean,max, attention pool, etc …</p>\n<p>also i do not have proper augmentation for multi-view (the views are related, so are the augmentation)</p>\n<hr>\n<p>on a site note, if i perform multi-view  learning on external vindr-mammo dataset with patch prediction (i.e. convert segmentation pixel label to patch label), the class activation maps do show better results on validation set.</p>",
              "rawMarkdown": "\"multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds\"\n\nhigher threshold is over fitting i i i think \nit seems that there is not enough data to do multiview prediction, it is quite a pity.\n\ni have to remove transformer and adopted simpler fusion like mean,max, attention pool, etc ...\n\nalso i do not have proper augmentation for multi-view (the views are related, so are the augmentation)\n\n---\n\non a site note, if i perform multi-view  learning on external vindr-mammo dataset with patch prediction (i.e. convert segmentation pixel label to patch label), the class activation maps do show better results on validation set.",
              "votes": 1
            },
            {
              "id": 2146870,
              "postDate": "2023-02-16T08:12:27.790Z",
              "content": "<p>When I tried your multi-image transformer, I had to freeze 70-80% of backbone blocks and used a very small lr to make it trainable. I also applied the same augmentation to all images per side, like this (albumentations is quite convenient)</p>\n<pre><code>transformed = augment(images=image0, images1=image1 ...)\n</code></pre>\n<p>I agree that we simply don't have enough data for multi-view training 😅. Simpler fusion models like boosted trees, mean, max might work better.</p>",
              "rawMarkdown": "When I tried your multi-image transformer, I had to freeze 70-80% of backbone blocks and used a very small lr to make it trainable. I also applied the same augmentation to all images per side, like this (albumentations is quite convenient)\n```\ntransformed = augment(images=image0, images1=image1 ...)\n```\nI agree that we simply don't have enough data for multi-view training 😅. Simpler fusion models like boosted trees, mean, max might work better.",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2108173,
      "postDate": "2023-01-20T10:10:07.493Z",
      "content": "<p>this is a cheap way to improve resolution and works for me at local CV</p>\n<p><img src=\"https://i.ibb.co/nsPnr58/Selection-602.png\" alt=\"https://i.ibb.co/nsPnr58/Selection-602.png\"></p>",
      "rawMarkdown": "this is a cheap way to improve resolution and works for me at local CV\n\n![https://i.ibb.co/nsPnr58/Selection-602.png](https://i.ibb.co/nsPnr58/Selection-602.png)",
      "votes": 5,
      "replies": [
        {
          "id": 2108177,
          "postDate": "2023-01-20T10:19:32.057Z",
          "content": "<p>Nice. As far as I understand gradient is updated from main loss?</p>",
          "rawMarkdown": "Nice. As far as I understand gradient is updated from main loss?",
          "replies": [
            {
              "id": 2108234,
              "postDate": "2023-01-20T11:09:38.887Z",
              "content": "<p>gradient is updated from main loss?</p>\n<p>no. all loss</p>",
              "rawMarkdown": "gradient is updated from main loss?\n\nno. all loss",
              "votes": 3
            },
            {
              "id": 2108239,
              "postDate": "2023-01-20T11:13:30.470Z",
              "content": "<p>Thank you for explanation. </p>",
              "rawMarkdown": "Thank you for explanation. "
            },
            {
              "id": 2108280,
              "postDate": "2023-01-20T11:52:28.547Z",
              "content": "<p>did you try different weighting for these losses ?</p>",
              "rawMarkdown": "did you try different weighting for these losses ?"
            },
            {
              "id": 2108977,
              "postDate": "2023-01-21T02:16:06.237Z",
              "content": "<p>I think this is a mix of two good ideas for aux loss + keeping hi-rez features. I tried something similar using resnet but it didn't improve my local CV.</p>\n<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> this reminds me of the paper (<a href=\"https://arxiv.org/pdf/1409.4842.pdf\" target=\"_blank\">Going deeper with convolutions</a>) from a while back, I recommend checking it out! It is also the first paper that I saw that references a meme 😄😄</p>\n<p><a href=\"https://www.kaggle.com/left13\" target=\"_blank\">@left13</a> aux loss weighting might be interesting to try out, they also do it in the paper I linked above<br>\n\"During training, their loss gets added to the total loss of the network with a discount weight (the losses of the auxiliary classifiers were weighted by 0.3). At inference time, these auxiliary networks are discarded.\" [Going deeper with convolutions, 6]</p>\n<p>I think if we were training from scratch it'll be a small boost to training time but I am interested in how each part affects CV for this competition since we are only fine-tuning the model</p>",
              "rawMarkdown": "I think this is a mix of two good ideas for aux loss + keeping hi-rez features. I tried something similar using resnet but it didn't improve my local CV.\n\n@remekkinas this reminds me of the paper ([Going deeper with convolutions](https://arxiv.org/pdf/1409.4842.pdf)) from a while back, I recommend checking it out! It is also the first paper that I saw that references a meme 😄😄\n\n@left13 aux loss weighting might be interesting to try out, they also do it in the paper I linked above\n\"During training, their loss gets added to the total loss of the network with a discount weight (the losses of the auxiliary classifiers were weighted by 0.3). At inference time, these auxiliary networks are discarded.\" [Going deeper with convolutions, 6]\n\nI think if we were training from scratch it'll be a small boost to training time but I am interested in how each part affects CV for this competition since we are only fine-tuning the model",
              "votes": 2
            }
          ]
        },
        {
          "id": 2110137,
          "postDate": "2023-01-22T02:08:28.810Z",
          "content": "<p>if you want to use tensorrt for this model, please note the pytorch resize bug<br>\n<a href=\"https://github.com/pytorch/TensorRT/pull/1561\" target=\"_blank\">https://github.com/pytorch/TensorRT/pull/1561</a><br>\nyou will have to modify the tensorrt py file</p>\n<p>alternatively, just convert the encoder to trt engine and use pytorch nn module for the rest</p>",
          "rawMarkdown": "if you want to use tensorrt for this model, please note the pytorch resize bug\nhttps://github.com/pytorch/TensorRT/pull/1561\nyou will have to modify the tensorrt py file\n\nalternatively, just convert the encoder to trt engine and use pytorch nn module for the rest",
          "votes": 1
        }
      ]
    },
    {
      "id": 2077872,
      "postDate": "2022-12-27T23:34:30.137Z",
      "content": "<p>finally, one paper that compares oversampling, undersampling and weighted class<br>\n<a href=\"https://ibb.co/PFvQqzb\"><img src=\"https://i.ibb.co/8NLc14R/Selection-322.png\" alt=\"Selection-322\"></a><br>\n<a href=\"https://ibb.co/HVLnx1g\"><img src=\"https://i.ibb.co/g3bzPHg/Selection-321.png\" alt=\"Selection-321\"></a></p>\n<p>[1] Comparing Techniques for Class Imbalance in Deep LearningComparing Techniques for Class Imbalance in Deep Learning<br>\nClassification of Breast CancerClassification of Breast Cancer</p>\n<p>the only conclusion is that no conclusion can be made</p>",
      "rawMarkdown": "finally, one paper that compares oversampling, undersampling and weighted class\n<a href=\"https://ibb.co/PFvQqzb\"><img src=\"https://i.ibb.co/8NLc14R/Selection-322.png\" alt=\"Selection-322\" border=\"0\"></a>\n<a href=\"https://ibb.co/HVLnx1g\"><img src=\"https://i.ibb.co/g3bzPHg/Selection-321.png\" alt=\"Selection-321\" border=\"0\"></a>\n\n[1] Comparing Techniques for Class Imbalance in Deep LearningComparing Techniques for Class Imbalance in Deep Learning\nClassification of Breast CancerClassification of Breast Cancer\n\n\nthe only conclusion is that no conclusion can be made",
      "votes": 5,
      "replies": [
        {
          "id": 2078070,
          "postDate": "2022-12-28T04:27:24.450Z",
          "content": "<p><a href=\"https://www.techrxiv.org/articles/preprint/Comparing_Techniques_for_Class_Imbalance_in_Deep_Learning_Classification_of_Breast_Cancer/21400632\" target=\"_blank\">https://www.techrxiv.org/articles/preprint/Comparing_Techniques_for_Class_Imbalance_in_Deep_Learning_Classification_of_Breast_Cancer/21400632</a></p>\n<p>I think the conclusion was generally that augmentation / pseudo labelling, especially domain specific augmentation (see the paper regarding how it does artifacting, makes a lot of sense) is effective when dealing with class imbalance.   Imho, this is smart oversampling.</p>",
          "rawMarkdown": "https://www.techrxiv.org/articles/preprint/Comparing_Techniques_for_Class_Imbalance_in_Deep_Learning_Classification_of_Breast_Cancer/21400632\n\nI think the conclusion was generally that augmentation / pseudo labelling, especially domain specific augmentation (see the paper regarding how it does artifacting, makes a lot of sense) is effective when dealing with class imbalance.   Imho, this is smart oversampling.",
          "votes": 2
        },
        {
          "id": 2087063,
          "postDate": "2023-01-05T09:38:21.357Z",
          "content": "<p>Hi, <br>\nIt seems that, choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.<br>\nBut there is one important thing the paper not answer, the sampling rate.<br>\nE.g. in over-sampling(ROS), higher pos. to neg. ratio would make the model overfit to pos.<br>\nThere is one recent paper[1], demonstrating this phenomena.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11665724%2F23f7d85d5c2233fe1dbe4cad50a4e72e%2F2023-01-05%205.31.30.png?generation=1672911121062365&amp;alt=media\" alt=\"\"><br>\nNote that, for the 4-layer case, pos:neg = 20:80(ROS-4) is the best choice.</p>\n<p>[1] The Effects of Data Sampling with Deep Learning and Highly Imbalanced Big Data, Information System Frontiers, Springer, 2020</p>",
          "rawMarkdown": "Hi, \nIt seems that, choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.\nBut there is one important thing the paper not answer, the sampling rate.\nE.g. in over-sampling(ROS), higher pos. to neg. ratio would make the model overfit to pos.\nThere is one recent paper[1], demonstrating this phenomena.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11665724%2F23f7d85d5c2233fe1dbe4cad50a4e72e%2F2023-01-05%205.31.30.png?generation=1672911121062365&alt=media)\nNote that, for the 4-layer case, pos:neg = 20:80(ROS-4) is the best choice.\n\n[1] The Effects of Data Sampling with Deep Learning and Highly Imbalanced Big Data, Information System Frontiers, Springer, 2020",
          "replies": [
            {
              "id": 2087167,
              "postDate": "2023-01-05T11:38:44.870Z",
              "content": "<p><img src=\"https://i.ibb.co/nM5HBTx/Selection-476.png\" alt=\"https://i.ibb.co/nM5HBTx/Selection-476.png\"></p>\n<p>most of the paper may not be useful because  results of imbalance data is very dependent on the data itself.</p>\n<p>here is how you should analyze. see the results of the validation above, the question you should ask is that \"can you draw the distribution of an unknown test LB data?</p>\n<p>[1] the distribution of the neg validation is smooth and predictable. How i think the test LB neg is close to the black dotted line.</p>\n<p>[2] for the pos validation, it is multi modal, unpredictable , it even have empty bins. That is why results is unpredictable.</p>\n<p>on a side note:</p>\n<ol>\n<li>this is why some kaggler reports better results for low false positive model (i.e. high correct neg rate). it is more stable.</li>\n<li>compare that with the train distribution. valid neg and train neg are close</li>\n<li>besides imbalance, there is other problem (e.g. high percentage of positive samples is almost non separable from neg, note that even human radiologist have low correct rate, that is why biopsy is required)</li>\n</ol>\n<p>if you are trying to use kaggle data to create a stable CV-LB, you should ask:</p>\n<ol>\n<li>is it possible?</li>\n<li>if not, where are other strategy</li>\n</ol>",
              "rawMarkdown": "![https://i.ibb.co/nM5HBTx/Selection-476.png](https://i.ibb.co/nM5HBTx/Selection-476.png)\n\nmost of the paper may not be useful because  results of imbalance data is very dependent on the data itself.\n\nhere is how you should analyze. see the results of the validation above, the question you should ask is that \"can you draw the distribution of an unknown test LB data?\n\n[1] the distribution of the neg validation is smooth and predictable. How i think the test LB neg is close to the black dotted line.\n\n[2] for the pos validation, it is multi modal, unpredictable , it even have empty bins. That is why results is unpredictable.\n\non a side note:\n\n1.  this is why some kaggler reports better results for low false positive model (i.e. high correct neg rate). it is more stable.\n2. compare that with the train distribution. valid neg and train neg are close\n3. besides imbalance, there is other problem (e.g. high percentage of positive samples is almost non separable from neg, note that even human radiologist have low correct rate, that is why biopsy is required)\n\nif you are trying to use kaggle data to create a stable CV-LB, you should ask:\n1. is it possible?\n2. if not, where are other strategy\n\n",
              "votes": 2
            },
            {
              "id": 2087171,
              "postDate": "2023-01-05T11:42:23.217Z",
              "content": "<p>\"choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.\"</p>\n<p>this is correct. it also depends on model.</p>",
              "rawMarkdown": "\"choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.\"\n\nthis is correct. it also depends on model."
            },
            {
              "id": 2087382,
              "postDate": "2023-01-05T15:03:33.950Z",
              "content": "<p>Thanks, your comments are very inspiring</p>",
              "rawMarkdown": "Thanks, your comments are very inspiring"
            }
          ]
        }
      ]
    },
    {
      "id": 2076911,
      "postDate": "2022-12-27T02:03:43.957Z",
      "content": "<p>is the cat out of the bag …. anyone caught the cat ???</p>\n<p><a href=\"https://pubs.rsna.org/doi/pdf/10.1148/ryai.220072\" target=\"_blank\">https://pubs.rsna.org/doi/pdf/10.1148/ryai.220072</a><br>\nADMANI:  Annotated Digital Mammograms and Associated Non-Image Datasets<br>\nPublished Online:Dec 21 2022</p>\n<p><img src=\"https://i.ibb.co/6YSxq3h/Selection-312.png\" alt=\"https://i.ibb.co/6YSxq3h/Selection-312.png\"></p>\n<p>\" A subset of 40,000 images from 10,000 episodes will be provided for the<br>\nRadiological Society of North America Mammography Breast Cancer Detection AI Challenge,<br>\nlaunching on November 28th. The challenge training dataset will be made public when the<br>\nchallenge is launched and will remain available to researchers when the challenge concludes.<br>\nThe 10,000 episodes will be randomly selected from the dataset from a three-year period.\"</p>\n<p><a href=\"https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge\" target=\"_blank\">https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge</a><br>\n\"The dataset was contributed by mammography screening programs in Australia and the U.S. It includes detailed labels, with radiologists’ evaluations and follow-up pathology results for suspected malignancies.\"</p>\n<p>aka site1 and site2</p>\n<p>maybe NYU + ADMANI???</p>\n<p>baseline results:<br>\nhere is a paper that compares results with and without NYU pretrain model:</p>\n<p>[1] Evaluation of deep learning-based artificial intelligence techniques for breast cancer detection on mammograms: Results from a retrospective study using a BreastScreen Victoria dataset  (part of ADMANI)</p>\n<p>[2] Multi-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation</p>",
      "rawMarkdown": "is the cat out of the bag .... anyone caught the cat ???\n\nhttps://pubs.rsna.org/doi/pdf/10.1148/ryai.220072\nADMANI:  Annotated Digital Mammograms and Associated Non-Image Datasets\nPublished Online:Dec 21 2022\n\n![https://i.ibb.co/6YSxq3h/Selection-312.png](https://i.ibb.co/6YSxq3h/Selection-312.png)\n\n\" A subset of 40,000 images from 10,000 episodes will be provided for the\nRadiological Society of North America Mammography Breast Cancer Detection AI Challenge,\nlaunching on November 28th. The challenge training dataset will be made public when the\nchallenge is launched and will remain available to researchers when the challenge concludes.\nThe 10,000 episodes will be randomly selected from the dataset from a three-year period.\"\n\nhttps://www.rsna.org/education/ai-resources-and-training/ai-image-challenge\n\"The dataset was contributed by mammography screening programs in Australia and the U.S. It includes detailed labels, with radiologists’ evaluations and follow-up pathology results for suspected malignancies.\"\n\naka site1 and site2\n\nmaybe NYU + ADMANI???\n\nbaseline results:\nhere is a paper that compares results with and without NYU pretrain model:\n\n[1] Evaluation of deep learning-based artificial intelligence techniques for breast cancer detection on mammograms: Results from a retrospective study using a BreastScreen Victoria dataset  (part of ADMANI)\n\n[2] Multi-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation\n",
      "votes": 5
    },
    {
      "id": 2084837,
      "postDate": "2023-01-03T19:36:40.053Z",
      "content": "<p>high quality \"Breast Micro-Calcifications Dataset with Precisely Annotated Sequential Mammograms\"</p>\n<p>dataset:<br>\n<a href=\"https://zenodo.org/record/5036062\" target=\"_blank\">https://zenodo.org/record/5036062</a></p>\n<p>paper:<br>\n[1] Loizidou, K., Skouroumouni, G., Pitris, C. et al. Digital subtraction of temporally sequential mammograms for improved detection and classification of microcalcifications. Eur Radiol Exp 5, 40 (2021). <a href=\"https://doi.org/10.1186/s41747-021-00238-w\" target=\"_blank\">https://doi.org/10.1186/s41747-021-00238-w</a></p>\n<p>papers that uses this dataset:<br>\n<a href=\"https://scholar.google.com/citations?user=qadXBKAAAAAJ&amp;hl=en\" target=\"_blank\">https://scholar.google.com/citations?user=qadXBKAAAAAJ&amp;hl=en</a></p>",
      "rawMarkdown": "high quality \"Breast Micro-Calcifications Dataset with Precisely Annotated Sequential Mammograms\"\n\ndataset:\nhttps://zenodo.org/record/5036062\n\npaper:\n[1] Loizidou, K., Skouroumouni, G., Pitris, C. et al. Digital subtraction of temporally sequential mammograms for improved detection and classification of microcalcifications. Eur Radiol Exp 5, 40 (2021). https://doi.org/10.1186/s41747-021-00238-w\n\npapers that uses this dataset:\nhttps://scholar.google.com/citations?user=qadXBKAAAAAJ&hl=en",
      "votes": 6
    },
    {
      "id": 2054402,
      "postDate": "2022-12-04T05:29:52.563Z",
      "content": "<p>some analysis<br>\n<img src=\"https://i.ibb.co/F8vKhbt/Selection-106.png\" alt=\"https://i.ibb.co/F8vKhbt/Selection-106.png\"></p>\n<p>the sorted probability (red-black) graph gives you an idea how the sample prediction values fluctuate with different models.<br>\nthis is important when you are making ensemble and choosing threshold value in pfbeta binarization. <br>\nthe threshold must be stable over the  fluctuation.</p>",
      "rawMarkdown": "some analysis\n![https://i.ibb.co/F8vKhbt/Selection-106.png](https://i.ibb.co/F8vKhbt/Selection-106.png)\n\nthe sorted probability (red-black) graph gives you an idea how the sample prediction values fluctuate with different models.\nthis is important when you are making ensemble and choosing threshold value in pfbeta binarization. \nthe threshold must be stable over the  fluctuation.\n",
      "votes": 5,
      "replies": [
        {
          "id": 2054726,
          "postDate": "2022-12-04T11:47:35.393Z",
          "content": "<p>Thanks! I see that you are using balance sampler, would be interesting compare with bce with loss weight with the same weights.</p>",
          "rawMarkdown": "Thanks! I see that you are using balance sampler, would be interesting compare with bce with loss weight with the same weights."
        },
        {
          "id": 2054865,
          "postDate": "2022-12-04T13:59:15.230Z",
          "content": "<p><img src=\"https://i.ibb.co/F0XkGHD/Selection-121.png\" alt=\"https://i.ibb.co/F0XkGHD/Selection-121.png\"></p>",
          "rawMarkdown": "![https://i.ibb.co/F0XkGHD/Selection-121.png](https://i.ibb.co/F0XkGHD/Selection-121.png)",
          "votes": 9
        },
        {
          "id": 2055140,
          "postDate": "2022-12-04T18:51:44.027Z",
          "content": "<p>i try to understand why resolution 1024 is better than 512. I show some CAM activation results for 1024 here (but i am not sure if the model is correct)</p>\n<p><a href=\"https://ibb.co/k3175S7\"><img src=\"https://i.ibb.co/0Bt7mG7/Selection-117.png\" alt=\"Selection-117\"></a><br>\n<a href=\"https://ibb.co/fFtzwBv\"><img src=\"https://i.ibb.co/4tMnr9d/Selection-116.png\" alt=\"Selection-116\"></a></p>",
          "rawMarkdown": "i try to understand why resolution 1024 is better than 512. I show some CAM activation results for 1024 here (but i am not sure if the model is correct)\n\n<a href=\"https://ibb.co/k3175S7\"><img src=\"https://i.ibb.co/0Bt7mG7/Selection-117.png\" alt=\"Selection-117\" border=\"0\"></a>\n<a href=\"https://ibb.co/fFtzwBv\"><img src=\"https://i.ibb.co/4tMnr9d/Selection-116.png\" alt=\"Selection-116\" border=\"0\"></a>",
          "votes": 8
        },
        {
          "id": 2055654,
          "postDate": "2022-12-05T09:31:50.267Z",
          "content": "<p>I am not familiar with mammography findings, but perhaps the visibility of calcification, which is typical of malignant findings, is very different between 512 and 1024?<br>\nBoth of the images you posted seem to focus on the fine calcifications, which are both parapetitive.</p>\n<p>EDIT: I don't think calcification is completely specific, as it can be seen not only in breast cancer but also in benign diseases.</p>",
          "rawMarkdown": "I am not familiar with mammography findings, but perhaps the visibility of calcification, which is typical of malignant findings, is very different between 512 and 1024?\nBoth of the images you posted seem to focus on the fine calcifications, which are both parapetitive.\n\nEDIT: I don't think calcification is completely specific, as it can be seen not only in breast cancer but also in benign diseases.",
          "votes": 5
        },
        {
          "id": 2056120,
          "postDate": "2022-12-05T18:40:11.017Z",
          "content": "<p>I can't speak to this specific image, but to the point <a href=\"https://www.kaggle.com/yosukeyama\" target=\"_blank\">@yosukeyama</a> made it's expected that the presence of some very small features (the calcifications) might favor models that use larger images. This article might provide useful context: <a href=\"https://radiopaedia.org/articles/breast-imaging-reporting-and-data-system-bi-rads\" target=\"_blank\">https://radiopaedia.org/articles/breast-imaging-reporting-and-data-system-bi-rads</a></p>",
          "rawMarkdown": "I can't speak to this specific image, but to the point @yosukeyama made it's expected that the presence of some very small features (the calcifications) might favor models that use larger images. This article might provide useful context: https://radiopaedia.org/articles/breast-imaging-reporting-and-data-system-bi-rads",
          "votes": 4
        },
        {
          "id": 2056132,
          "postDate": "2022-12-05T19:05:44.347Z",
          "content": "<p>Addition to the dim. questions, can we lose some important grey level information in the png conversion from dicom and maybe it would be better using e.g. NIfTI-format, or do we have all information needed by using windowing features?</p>",
          "rawMarkdown": "Addition to the dim. questions, can we lose some important grey level information in the png conversion from dicom and maybe it would be better using e.g. NIfTI-format, or do we have all information needed by using windowing features?",
          "votes": 2
        },
        {
          "id": 2057734,
          "postDate": "2022-12-07T10:11:06.943Z",
          "content": "<p>i show CAM heatmap for an external dataset with lesion annotation<br>\n<a href=\"https://vindr.ai/datasets/mammo\" target=\"_blank\">https://vindr.ai/datasets/mammo</a></p>\n<p><a href=\"https://ibb.co/dfhfDt4\"><img src=\"https://i.ibb.co/p1m1dQj/0-991211-9b28bca8f8312283e4fd9f093646b04b.png\" alt=\"0-991211-9b28bca8f8312283e4fd9f093646b04b\"></a><br>\n<a href=\"https://ibb.co/44HtqNQ\"><img src=\"https://i.ibb.co/RQqbFH5/0-958984-dec4540f406b4e556983b4f76504ee30.png\" alt=\"0-958984-dec4540f406b4e556983b4f76504ee30\"></a><br>\n<a href=\"https://ibb.co/xsTWpHb\"><img src=\"https://i.ibb.co/SxCbhrg/0-854492-19acc4b912b5637af651392bc1fe6b6e.png\" alt=\"0-854492-19acc4b912b5637af651392bc1fe6b6e\"></a><br>\n<a href=\"https://ibb.co/Fm26cjZ\"><img src=\"https://i.ibb.co/xXWhwR9/0-735352-f54b07517cb46e8a59c1c10748bdb5ed.png\" alt=\"0-735352-f54b07517cb46e8a59c1c10748bdb5ed\"></a><br>\n<a href=\"https://ibb.co/DMrXMz2\"><img src=\"https://i.ibb.co/n1P216J/0-682617-735851f234a657318773c4cbbe4969cf.png\" alt=\"0-682617-735851f234a657318773c4cbbe4969cf\"></a><br>\n<a href=\"https://ibb.co/JyL5tWZ\"><img src=\"https://i.ibb.co/yYTWPm2/0-587891-d83b16559c3ad828bd86db23e4f11243.png\" alt=\"0-587891-d83b16559c3ad828bd86db23e4f11243\"></a><br>\n<a href=\"https://ibb.co/XxfV1Sn\"><img src=\"https://i.ibb.co/8gnXq6y/0-425781-6057b80f4f3e7d18f2bac341f7a64e07.png\" alt=\"0-425781-6057b80f4f3e7d18f2bac341f7a64e07\"></a><br>\n<a href=\"https://ibb.co/XpkrPbB\"><img src=\"https://i.ibb.co/Mp5xHsT/0-371338-83be060130997ca7b67b3979978a5d29.png\" alt=\"0-371338-83be060130997ca7b67b3979978a5d29\"></a><br>\n<a href=\"https://ibb.co/SnCNx8d\"><img src=\"https://i.ibb.co/Yks2WMy/0-347656-31fcc94f3079f2b234c6e4304ab540e3.png\" alt=\"0-347656-31fcc94f3079f2b234c6e4304ab540e3\"></a><br>\n<a href=\"https://ibb.co/N64s79K\"><img src=\"https://i.ibb.co/JRhKCvH/0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9.png\" alt=\"0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9\"></a><br>\n<a href=\"https://ibb.co/VxFXH9q\"><img src=\"https://i.ibb.co/YX5vDQL/0-262451-07e191bc54c3378f9fdf23ddecc47420.png\" alt=\"0-262451-07e191bc54c3378f9fdf23ddecc47420\"></a></p>\n<p>i am glad that for high predicted probability, the model (single fold 1024) performs quite well.<br>\nhowever t there are many misses. I think this is due to lack of kaggle train data.</p>\n<p>use of external will play an important part in this competition</p>",
          "rawMarkdown": "i show CAM heatmap for an external dataset with lesion annotation\nhttps://vindr.ai/datasets/mammo\n\n<a href=\"https://ibb.co/dfhfDt4\"><img src=\"https://i.ibb.co/p1m1dQj/0-991211-9b28bca8f8312283e4fd9f093646b04b.png\" alt=\"0-991211-9b28bca8f8312283e4fd9f093646b04b\" border=\"0\"></a>\n<a href=\"https://ibb.co/44HtqNQ\"><img src=\"https://i.ibb.co/RQqbFH5/0-958984-dec4540f406b4e556983b4f76504ee30.png\" alt=\"0-958984-dec4540f406b4e556983b4f76504ee30\" border=\"0\"></a>\n<a href=\"https://ibb.co/xsTWpHb\"><img src=\"https://i.ibb.co/SxCbhrg/0-854492-19acc4b912b5637af651392bc1fe6b6e.png\" alt=\"0-854492-19acc4b912b5637af651392bc1fe6b6e\" border=\"0\"></a>\n<a href=\"https://ibb.co/Fm26cjZ\"><img src=\"https://i.ibb.co/xXWhwR9/0-735352-f54b07517cb46e8a59c1c10748bdb5ed.png\" alt=\"0-735352-f54b07517cb46e8a59c1c10748bdb5ed\" border=\"0\"></a>\n<a href=\"https://ibb.co/DMrXMz2\"><img src=\"https://i.ibb.co/n1P216J/0-682617-735851f234a657318773c4cbbe4969cf.png\" alt=\"0-682617-735851f234a657318773c4cbbe4969cf\" border=\"0\"></a>\n<a href=\"https://ibb.co/JyL5tWZ\"><img src=\"https://i.ibb.co/yYTWPm2/0-587891-d83b16559c3ad828bd86db23e4f11243.png\" alt=\"0-587891-d83b16559c3ad828bd86db23e4f11243\" border=\"0\"></a>\n<a href=\"https://ibb.co/XxfV1Sn\"><img src=\"https://i.ibb.co/8gnXq6y/0-425781-6057b80f4f3e7d18f2bac341f7a64e07.png\" alt=\"0-425781-6057b80f4f3e7d18f2bac341f7a64e07\" border=\"0\"></a>\n<a href=\"https://ibb.co/XpkrPbB\"><img src=\"https://i.ibb.co/Mp5xHsT/0-371338-83be060130997ca7b67b3979978a5d29.png\" alt=\"0-371338-83be060130997ca7b67b3979978a5d29\" border=\"0\"></a>\n<a href=\"https://ibb.co/SnCNx8d\"><img src=\"https://i.ibb.co/Yks2WMy/0-347656-31fcc94f3079f2b234c6e4304ab540e3.png\" alt=\"0-347656-31fcc94f3079f2b234c6e4304ab540e3\" border=\"0\"></a>\n<a href=\"https://ibb.co/N64s79K\"><img src=\"https://i.ibb.co/JRhKCvH/0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9.png\" alt=\"0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9\" border=\"0\"></a>\n<a href=\"https://ibb.co/VxFXH9q\"><img src=\"https://i.ibb.co/YX5vDQL/0-262451-07e191bc54c3378f9fdf23ddecc47420.png\" alt=\"0-262451-07e191bc54c3378f9fdf23ddecc47420\" border=\"0\"></a>\n\n\ni am glad that for high predicted probability, the model (single fold 1024) performs quite well.\nhowever t there are many misses. I think this is due to lack of kaggle train data.\n\nuse of external will play an important part in this competition\n",
          "votes": 7
        },
        {
          "id": 2058004,
          "postDate": "2022-12-07T14:37:27.680Z",
          "content": "<p>2048 is the king?</p>\n<p><img src=\"https://i.ibb.co/8rk2PyZ/Selection-134.png\" alt=\"https://i.ibb.co/8rk2PyZ/Selection-134.png\"></p>\n<p>anyone has good suggestion for a low-memory, low flop model that might work well for 2048?</p>",
          "rawMarkdown": "2048 is the king?\n\n![https://i.ibb.co/8rk2PyZ/Selection-134.png](https://i.ibb.co/8rk2PyZ/Selection-134.png)\n\nanyone has good suggestion for a low-memory, low flop model that might work well for 2048?",
          "votes": 3
        },
        {
          "id": 2058540,
          "postDate": "2022-12-08T02:27:18.853Z",
          "content": "<p>check the distribution diagram<br>\n<a href=\"https://miro.medium.com/max/720/1*yF319EgJVzag9pd2ZL4D4Q.webp\" target=\"_blank\">https://miro.medium.com/max/720/1*yF319EgJVzag9pd2ZL4D4Q.webp</a></p>\n<p>it compare bce loss and soft-f1 loss</p>\n<p><a href=\"https://towardsdatascience.com/the-unknown-benefits-of-using-a-soft-f1-loss-in-classification-systems-753902c0105d\" target=\"_blank\">https://towardsdatascience.com/the-unknown-benefits-of-using-a-soft-f1-loss-in-classification-systems-753902c0105d</a></p>",
          "rawMarkdown": "check the distribution diagram\nhttps://miro.medium.com/max/720/1*yF319EgJVzag9pd2ZL4D4Q.webp\n\nit compare bce loss and soft-f1 loss\n\nhttps://towardsdatascience.com/the-unknown-benefits-of-using-a-soft-f1-loss-in-classification-systems-753902c0105d\n\n"
        },
        {
          "id": 2058880,
          "postDate": "2022-12-08T09:28:06.033Z",
          "content": "<blockquote>\n  <p>anyone has good suggestion for a low-memory, low flop model that might work well for 2048?</p>\n</blockquote>\n<p>Teacher-student architectur and knowledge distillation?</p>",
          "rawMarkdown": "> anyone has good suggestion for a low-memory, low flop model that might work well for 2048?\n\nTeacher-student architectur and knowledge distillation?"
        },
        {
          "id": 2058958,
          "postDate": "2022-12-08T11:00:11.143Z",
          "content": "<p><img src=\"https://i.ibb.co/rwkSLfG/Selection-138.png\" alt=\"https://i.ibb.co/rwkSLfG/Selection-138.png\"></p>\n<p>i added a head to learn the best probability calibration for maximizing kaggle metric F1.<br>\nIn the end, it is the same as hard binary thresholding</p>",
          "rawMarkdown": "![https://i.ibb.co/rwkSLfG/Selection-138.png](https://i.ibb.co/rwkSLfG/Selection-138.png)\n\ni added a head to learn the best probability calibration for maximizing kaggle metric F1.\nIn the end, it is the same as hard binary thresholding",
          "votes": 6
        },
        {
          "id": 2060543,
          "postDate": "2022-12-10T05:30:07.960Z",
          "content": "<p>Good explanation, well🙌</p>",
          "rawMarkdown": "Good explanation, well🙌"
        }
      ]
    },
    {
      "id": 2162027,
      "postDate": "2023-02-28T00:07:40.403Z",
      "content": "<p>results are out!</p>\n<p>3 fold nextvit-b  has private lb 0.48.<br>\n1  fold nextvit-b  has private lb 0.45.</p>\n<p>but unfornately, i didn't select that</p>\n<p><img src=\"https://i.ibb.co/bWXKr73/Selection-999-1157.png\" alt=\"https://i.ibb.co/bWXKr73/Selection-999-1157.png\"></p>",
      "rawMarkdown": "results are out!\n\n3 fold nextvit-b  has private lb 0.48.\n1  fold nextvit-b  has private lb 0.45.\n\nbut unfornately, i didn't select that\n\n![https://i.ibb.co/bWXKr73/Selection-999-1157.png](https://i.ibb.co/bWXKr73/Selection-999-1157.png)",
      "votes": 4,
      "replies": [
        {
          "id": 2162347,
          "postDate": "2023-02-28T06:33:21.303Z",
          "content": "<p>May I ask why you chose 1-fold over 3-fold solution?</p>",
          "rawMarkdown": "May I ask why you chose 1-fold over 3-fold solution?"
        }
      ]
    },
    {
      "id": 2113008,
      "postDate": "2023-01-24T02:53:04.297Z",
      "content": "<p>sometimes you want to modify timms model without messing of the original  code. Here is a way to do it:</p>\n<pre><code>from timm.models.convnext import _create_convnext\n\ndef convnext_tiny(pretrained=False, **kwargs):\n    model_args = dict(depths=(3, 3, 9, 3), dims=(96, 192, 384, 768), **kwargs)\n    model = _create_convnext('convnext_tiny.in12k_ft_in1k_384', pretrained=pretrained, **model_args)\n    setattr(model, 'depths', [3, 3, 9, 3])\n    return model\n\n\n#modify to output all layers\nclass Encoder(nn.Module):\n    def __init__(self, ):\n        super(Encoder, self).__init__()\n        e = convnext_tiny(pretrained=True)\n        self.stem = e.stem\n        self.stage1 = e.stages[         0  : e.depths[0]]\n        self.stage2 = e.stages[e.depths[0] : e.depths[1]]\n        self.stage3 = e.stages[e.depths[1] : e.depths[2]]\n        self.stage4 = e.stages[e.depths[2] : e.depths[3]]\n        self.norm_pre = e.norm_pre\n        del e\n\n    def forward(self, x):\n        x0 = self.stem(x)\n        x1 = self.stage1(x0)\n        x2 = self.stage2(x1)\n        x3 = self.stage3(x2)\n        x4 = self.stage4(x3)\n        return [x1,x2,x3,x4]\n</code></pre>",
      "rawMarkdown": "sometimes you want to modify timms model without messing of the original  code. Here is a way to do it:\n\n```\n\nfrom timm.models.convnext import _create_convnext\n\ndef convnext_tiny(pretrained=False, **kwargs):\n\tmodel_args = dict(depths=(3, 3, 9, 3), dims=(96, 192, 384, 768), **kwargs)\n\tmodel = _create_convnext('convnext_tiny.in12k_ft_in1k_384', pretrained=pretrained, **model_args)\n\tsetattr(model, 'depths', [3, 3, 9, 3])\n\treturn model\n\n\n#modify to output all layers\nclass Encoder(nn.Module):\n\tdef __init__(self, ):\n\t\tsuper(Encoder, self).__init__()\n\t\te = convnext_tiny(pretrained=True)\n\t\tself.stem = e.stem\n\t\tself.stage1 = e.stages[         0  : e.depths[0]]\n\t\tself.stage2 = e.stages[e.depths[0] : e.depths[1]]\n\t\tself.stage3 = e.stages[e.depths[1] : e.depths[2]]\n\t\tself.stage4 = e.stages[e.depths[2] : e.depths[3]]\n\t\tself.norm_pre = e.norm_pre\n\t\tdel e\n\n\tdef forward(self, x):\n\t\tx0 = self.stem(x)\n\t\tx1 = self.stage1(x0)\n\t\tx2 = self.stage2(x1)\n\t\tx3 = self.stage3(x2)\n\t\tx4 = self.stage4(x3)\n\t\treturn [x1,x2,x3,x4]\n\n```\n",
      "votes": 4
    },
    {
      "id": 2086023,
      "postDate": "2023-01-04T14:11:45.297Z",
      "content": "<p>in order to improve the detection rate, one may want to flip some labels:<br>\ne.g. <br>\ndifficult_negative_case =1, biopsy=1 --&gt; cancer =1<br>\n(since it is sent for biopsy, it should be visually close to malignant )</p>",
      "rawMarkdown": "in order to improve the detection rate, one may want to flip some labels:\ne.g. \ndifficult_negative_case =1, biopsy=1 --> cancer =1\n(since it is sent for biopsy, it should be visually close to malignant )",
      "votes": 3,
      "replies": [
        {
          "id": 2086062,
          "postDate": "2023-01-04T14:40:53.137Z",
          "content": "<p>tried that but no improvement. might need to add density type as well</p>",
          "rawMarkdown": "tried that but no improvement. might need to add density type as well",
          "votes": 1
        }
      ]
    },
    {
      "id": 2084695,
      "postDate": "2023-01-03T17:18:02.053Z",
      "content": "<p><a href=\"https://github.com/nyukat/BIRADS_classifier\" target=\"_blank\">https://github.com/nyukat/BIRADS_classifier</a><br>\n<a href=\"https://cs.nyu.edu/~kgeras/reports/datav1.0.pdf\" target=\"_blank\">https://cs.nyu.edu/~kgeras/reports/datav1.0.pdf</a></p>\n<p>How to map external data to kaggle label</p>\n<p>\"As BI-RADS 0 and BI-RADS 1 and BI-RADS 2 should be the only BI-RADS categories used in screening mammography,<br>\nwe condensed all BI-RADS categories into three classes for the purposes of training our model.\" </p>\n<p>BI-RADS 0, 4a/b/c and 5 were mapped to a new ‘BI-RADS 0’ as each indicates a possibility of malignancy. <br>\nBI-RADS 1 is retained at ‘BI-RADS1’. <br>\nBI-RADS 2 and 3 are mapped to a new ‘BI-RADS 2’, as they both indicate benign findings. </p>\n<p>This procedure resulted in a dataset consisting of a single BI-RADS label over three classes for each of our valid screening mammography exams.\"</p>\n<hr>\n<p>BI-RADS categories:<br>\n0 (‘incomplete’), <br>\n1 (‘negative’), <br>\n2 (‘benign’), <br>\n3 (‘probably benign’), <br>\n4a (‘low suspicious’), <br>\n4b (‘moderate sus-picious’), <br>\n4c (‘high suspicious’) <br>\n5 (‘highly suggestive of malignancy’)<br>\n6 (‘known biopsy with proven malignancy’)</p>",
      "rawMarkdown": "https://github.com/nyukat/BIRADS_classifier\nhttps://cs.nyu.edu/~kgeras/reports/datav1.0.pdf\n\nHow to map external data to kaggle label\n\n\"As BI-RADS 0 and BI-RADS 1 and BI-RADS 2 should be the only BI-RADS categories used in screening mammography,\nwe condensed all BI-RADS categories into three classes for the purposes of training our model.\" \n\nBI-RADS 0, 4a/b/c and 5 were mapped to a new ‘BI-RADS 0’ as each indicates a possibility of malignancy. \nBI-RADS 1 is retained at ‘BI-RADS1’. \nBI-RADS 2 and 3 are mapped to a new ‘BI-RADS 2’, as they both indicate benign findings. \n\nThis procedure resulted in a dataset consisting of a single BI-RADS label over three classes for each of our valid screening mammography exams.\"\n\n---\n\nBI-RADS categories:\n0 (‘incomplete’), \n1 (‘negative’), \n2 (‘benign’), \n3 (‘probably benign’), \n4a (‘low suspicious’), \n4b (‘moderate sus-picious’), \n4c (‘high suspicious’) \n5 (‘highly suggestive of malignancy’)\n6 (‘known biopsy with proven malignancy’)\n\n",
      "votes": 3,
      "replies": [
        {
          "id": 2085620,
          "postDate": "2023-01-04T09:33:32.467Z",
          "content": "<p>The paper you link to is from 2019, correct?  That's 3 years ago.  I wonder if they've enhanced the labelling given what's occurred since then.</p>",
          "rawMarkdown": "The paper you link to is from 2019, correct?  That's 3 years ago.  I wonder if they've enhanced the labelling given what's occurred since then."
        }
      ]
    },
    {
      "id": 2082873,
      "postDate": "2023-01-02T03:44:08.533Z",
      "content": "<p>results on large scale external data (vindr) is pretty much the same as kaggle data:</p>\n<p><a href=\"https://ibb.co/0GhrXTM\"><img src=\"https://i.ibb.co/3CBcs2N/Picture1.png\" alt=\"Picture1\"></a></p>",
      "rawMarkdown": "results on large scale external data (vindr) is pretty much the same as kaggle data:\n\n<a href=\"https://ibb.co/0GhrXTM\"><img src=\"https://i.ibb.co/3CBcs2N/Picture1.png\" alt=\"Picture1\" border=\"0\"></a>",
      "votes": 3,
      "replies": [
        {
          "id": 2083835,
          "postDate": "2023-01-02T22:38:43.980Z",
          "content": "<p>Hey, I am a novice and I have a question, did you train on Kaggle and predict on Vindr? I am trying to figure out a good CV step because I have doubts about mine. Since we are thresholding, would holdout and N-fold CV be better to find a threshold for the competition dataset? And can we use Vindr as the holdout if it is similar as you mentioned?</p>\n<p>If the Vindr dataset is very similar to Kaggle's I am sure we can use it to validate models (I think this won't go against their license since we are not training on it).</p>",
          "rawMarkdown": "Hey, I am a novice and I have a question, did you train on Kaggle and predict on Vindr? I am trying to figure out a good CV step because I have doubts about mine. Since we are thresholding, would holdout and N-fold CV be better to find a threshold for the competition dataset? And can we use Vindr as the holdout if it is similar as you mentioned?\n\nIf the Vindr dataset is very similar to Kaggle's I am sure we can use it to validate models (I think this won't go against their license since we are not training on it).",
          "votes": 2,
          "replies": [
            {
              "id": 2083921,
              "postDate": "2023-01-03T01:08:00.367Z",
              "content": "<p>[1] Can Vindr be used in the solution at all?</p>\n<p>i haven't considered this yet. my current objective is to get a good way to understand the problem, training and metrics first. maybe it is possible that Vindr is not allowed and i will deal with that later. Vindr is currently investigated, because i can get benchmark results form paper and there are more annotation like bounding box, etc for experiments.</p>\n<p>[2] did you train on Kaggle and predict on Vindr?</p>\n<p>results are based on training = Vindr,  testing = Vindr. I am just repeating the paper results to confirm my pipeline  is correct.</p>\n<hr>\n<p>Even with Vindr, the metrics are not stable (both AUC and F1 score). Vindr is still not large enough. I think the reason is as follows:</p>\n<ul>\n<li><p>pure visual diagnostics from image mammography has its limitation.  Positive predictive value (PPV), aka. precision, of radiologist  in  screening is not high. that is why biopsy is needed to confirm cancer cases.</p></li>\n<li><p>that is why just only based on  visual evidence, given a choice to improve either sensitivity (tp rate) or specificity (tn rate), it is \"easier\" for the model to choose specificity. You can better metrics because there are much more neg samples (imbalance)  and more likely to be correct (given same detectable visual abnormality, it is more likely to be benign)</p></li>\n</ul>\n<p>you can google for PPV for abnormality in mammography screening  for more information </p>\n<p>Hence there is probably no good metric. and you are not likely to see good CV-LB as you would usually would in previous problems with better data. </p>\n<hr>\n<p>You will also see that for papers that conduct experiments on various datasets (instead of one), metrics on various datasets various. Results are more stable for those that uses millions of training images (from 1 million to 4 million).</p>\n<p>since you are a student, i strong encourage you to apply for those million image dataset like OPTIMAM, CSAW, AMAINDA and conduct experiments on those (but note that they cannot be used for kaggle solutions if you are aiming for prize). These are open to public but by need email request. You will get a bigger picture on stable CV. </p>\n<p>The next best thing is to read papers on those big dataset.</p>\n<hr>\n<p>Then how to approach this competition?</p>\n<p>diversity:</p>\n<ul>\n<li>different models and different solutions (not just change the backbone)</li>\n<li>more different datasets to train or validate (one or two or even three are not enough)</li>\n</ul>\n<p>\"if diverse solution agrees on diverse datasets with diverse metrics, they are probably more correct\".</p>",
              "rawMarkdown": "[1] Can Vindr be used in the solution at all?\n\ni haven't considered this yet. my current objective is to get a good way to understand the problem, training and metrics first. maybe it is possible that Vindr is not allowed and i will deal with that later. Vindr is currently investigated, because i can get benchmark results form paper and there are more annotation like bounding box, etc for experiments.\n\n[2] did you train on Kaggle and predict on Vindr?\n\nresults are based on training = Vindr,  testing = Vindr. I am just repeating the paper results to confirm my pipeline  is correct.\n\n---\n\nEven with Vindr, the metrics are not stable (both AUC and F1 score). Vindr is still not large enough. I think the reason is as follows:\n\n- pure visual diagnostics from image mammography has its limitation.  Positive predictive value (PPV), aka. precision, of radiologist  in  screening is not high. that is why biopsy is needed to confirm cancer cases.\n\n- that is why just only based on  visual evidence, given a choice to improve either sensitivity (tp rate) or specificity (tn rate), it is \"easier\" for the model to choose specificity. You can better metrics because there are much more neg samples (imbalance)  and more likely to be correct (given same detectable visual abnormality, it is more likely to be benign)\n\nyou can google for PPV for abnormality in mammography screening  for more information \n\nHence there is probably no good metric. and you are not likely to see good CV-LB as you would usually would in previous problems with better data. \n\n---\n\nYou will also see that for papers that conduct experiments on various datasets (instead of one), metrics on various datasets various. Results are more stable for those that uses millions of training images (from 1 million to 4 million).\n\nsince you are a student, i strong encourage you to apply for those million image dataset like OPTIMAM, CSAW, AMAINDA and conduct experiments on those (but note that they cannot be used for kaggle solutions if you are aiming for prize). These are open to public but by need email request. You will get a bigger picture on stable CV. \n\nThe next best thing is to read papers on those big dataset.\n\n---\n\nThen how to approach this competition?\n\ndiversity:\n- different models and different solutions (not just change the backbone)\n- more different datasets to train or validate (one or two or even three are not enough)\n\n\"if diverse solution agrees on diverse datasets with diverse metrics, they are probably more correct\".\n  ",
              "votes": 4
            },
            {
              "id": 2083930,
              "postDate": "2023-01-03T01:18:52.607Z",
              "content": "<p>Thanks for your insights, I will continue learning!</p>",
              "rawMarkdown": "Thanks for your insights, I will continue learning!"
            },
            {
              "id": 2084004,
              "postDate": "2023-01-03T04:07:33.927Z",
              "content": "<p><img src=\"https://i.imgur.com/poP7qN6.png\" alt=\"https://i.imgur.com/poP7qN6.png\"></p>\n<p>an example of repeating results. you can see how the results varies</p>",
              "rawMarkdown": "![https://i.imgur.com/poP7qN6.png](https://i.imgur.com/poP7qN6.png)\n\nan example of repeating results. you can see how the results varies",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2057901,
      "postDate": "2022-12-07T12:42:41.050Z",
      "content": "<p>mixed results of dicom intensity windowing</p>\n<p><img src=\"https://i.ibb.co/t4TFG9z/Selection-127.png\" alt=\"https://i.ibb.co/t4TFG9z/Selection-127.png\"></p>",
      "rawMarkdown": "mixed results of dicom intensity windowing\n\n![https://i.ibb.co/t4TFG9z/Selection-127.png](https://i.ibb.co/t4TFG9z/Selection-127.png)",
      "votes": 3,
      "replies": [
        {
          "id": 2079529,
          "postDate": "2022-12-29T11:51:14.847Z",
          "content": "<p>Applying window operation on the fly is too expensive though. Maybe you can try stacking 2 different windowed output on channel dimension.</p>",
          "rawMarkdown": "Applying window operation on the fly is too expensive though. Maybe you can try stacking 2 different windowed output on channel dimension."
        }
      ]
    },
    {
      "id": 2065229,
      "postDate": "2022-12-14T12:25:30.160Z",
      "content": "<p>how to set pos weight in loss to maximize f1 score for imbalanced class<br>\n<a href=\"http://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html\" target=\"_blank\">http://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html</a></p>",
      "rawMarkdown": "how to set pos weight in loss to maximize f1 score for imbalanced class\nhttp://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html",
      "votes": 4,
      "replies": [
        {
          "id": 2065244,
          "postDate": "2022-12-14T12:42:40.230Z",
          "content": "<p>Balance using Sampler or loss weights … or both?</p>",
          "rawMarkdown": "Balance using Sampler or loss weights ... or both?"
        },
        {
          "id": 2065446,
          "postDate": "2022-12-14T17:02:07.163Z",
          "content": "<p>still experimenting. i not sure if there will be a shakeup because for the same single one-fold model + the same data that is trained differently, i can get very different lb scores of 0.39 to 0.51.</p>",
          "rawMarkdown": "still experimenting. i not sure if there will be a shakeup because for the same single one-fold model + the same data that is trained differently, i can get very different lb scores of 0.39 to 0.51."
        },
        {
          "id": 2065958,
          "postDate": "2022-12-15T08:34:21.677Z",
          "content": "<p>Do you use BalancedSampler presented in your code? If yes I think that a bit of instability in score could cause this line:</p>\n<pre><code> pos_index = np.random.choice(pos_index, self.length//self.r).reshape(-1,1)\n</code></pre>\n<p>what do you think?</p>",
          "rawMarkdown": "Do you use BalancedSampler presented in your code? If yes I think that a bit of instability in score could cause this line:\n\n```\n pos_index = np.random.choice(pos_index, self.length//self.r).reshape(-1,1)\n```\n\nwhat do you think?",
          "votes": 1
        }
      ]
    },
    {
      "id": 2059570,
      "postDate": "2022-12-09T03:16:02.913Z",
      "content": "<p>validation results are complementary. This means that 2048 model is improving different samples from 1024.<br>\nin particular, AUC of large image is much lower (probably improving the previous low p=0 region)<br>\npfbeta of large model is better (probably improving the previous mid p=0.5 region)</p>\n<pre><code>image-wise validation results (fold-0)\n\n\neffb2-2048\nbce_loss    AUC pfbeta\n0.09397     0.82092     0.19947 \n\neffb6-1024\nbce_loss    AUC pfbeta\n0.106  0.7949  0.263  \n</code></pre>\n<hr>\n<p>LB results of 2048</p>\n<p><img src=\"https://i.ibb.co/qpqHVhT/Selection-146.png\" alt=\"https://i.ibb.co/qpqHVhT/Selection-146.png\"></p>\n<p>when ensemble of multiple input size are used, i first  convert dicom to the largest size png with cv2.resize(). <br>\nthen, pytorch F.interpolate() function is used to create the smaller size image in net forward(). <br>\nthis is different from training and maybe the cause of poor performance?</p>",
      "rawMarkdown": "validation results are complementary. This means that 2048 model is improving different samples from 1024.\nin particular, AUC of large image is much lower (probably improving the previous low p=0 region)\npfbeta of large model is better (probably improving the previous mid p=0.5 region)\n\n```\n\nimage-wise validation results (fold-0)\n\n\neffb2-2048\nbce_loss\tAUC\tpfbeta\n0.09397 \t0.82092 \t0.19947 \n\neffb6-1024\nbce_loss\tAUC\tpfbeta\n0.106  0.7949  0.263  \n\n```   \n\n---\nLB results of 2048\n\n![https://i.ibb.co/qpqHVhT/Selection-146.png](https://i.ibb.co/qpqHVhT/Selection-146.png)\n\nwhen ensemble of multiple input size are used, i first  convert dicom to the largest size png with cv2.resize(). \nthen, pytorch F.interpolate() function is used to create the smaller size image in net forward(). \nthis is different from training and maybe the cause of poor performance?",
      "votes": 4
    },
    {
      "id": 2059554,
      "postDate": "2022-12-09T02:23:49.243Z",
      "content": "<p>interesting paper <br>\ncvpr2022:<br>\nEfficient Classification of Very Large Images with Tiny Objects<br>\n<a href=\"https://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf\" target=\"_blank\">https://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf</a></p>",
      "rawMarkdown": "interesting paper \ncvpr2022:\nEfficient Classification of Very Large Images with Tiny Objects\nhttps://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf\n",
      "votes": 4
    },
    {
      "id": 2055186,
      "postDate": "2022-12-04T20:12:13.743Z",
      "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> great analysis!</p>",
      "rawMarkdown": "Thanks for sharing @hengck23 great analysis!",
      "votes": 4
    },
    {
      "id": 2054612,
      "postDate": "2022-12-04T09:29:51.753Z",
      "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> I am learning a lot from these. Much appreciated.</p>",
      "rawMarkdown": "@hengck23 I am learning a lot from these. Much appreciated.",
      "votes": 4
    },
    {
      "id": 2149480,
      "postDate": "2023-02-18T10:58:31.413Z",
      "content": "<p>some cam map thoughts:<br>\n<a href=\"https://ibb.co/Chz661w\"><img src=\"https://i.ibb.co/HnVCCFK/Selection-999-757.png\" alt=\"Selection-999-757\"></a><br>\n<a href=\"https://ibb.co/gD5Lrrp\"><img src=\"https://i.ibb.co/zSyTmmY/Selection-999-758.png\" alt=\"Selection-999-758\"></a></p>\n<p><a href=\"https://ibb.co/KXF9Kqf\"><img src=\"https://i.ibb.co/kxQhm8w/Selection-999-759.png\" alt=\"Selection-999-759\"></a><br>\n<a href=\"https://ibb.co/hsxV02P\"><img src=\"https://i.ibb.co/F6kzp8S/Selection-999-760.png\" alt=\"Selection-999-760\"></a></p>",
      "rawMarkdown": "some cam map thoughts:\n<a href=\"https://ibb.co/Chz661w\"><img src=\"https://i.ibb.co/HnVCCFK/Selection-999-757.png\" alt=\"Selection-999-757\" border=\"0\"></a>\n<a href=\"https://ibb.co/gD5Lrrp\"><img src=\"https://i.ibb.co/zSyTmmY/Selection-999-758.png\" alt=\"Selection-999-758\" border=\"0\"></a>\n\n<a href=\"https://ibb.co/KXF9Kqf\"><img src=\"https://i.ibb.co/kxQhm8w/Selection-999-759.png\" alt=\"Selection-999-759\" border=\"0\"></a>\n<a href=\"https://ibb.co/hsxV02P\"><img src=\"https://i.ibb.co/F6kzp8S/Selection-999-760.png\" alt=\"Selection-999-760\" border=\"0\"></a>\n\n",
      "votes": 1,
      "replies": [
        {
          "id": 2149544,
          "postDate": "2023-02-18T12:23:21.710Z",
          "content": "<p>i suddenly have interesting question. maybe someone can take this as future research.<br>\nif i purposely mislabelled a negative image as positive for training, what would the CAM heatmap show? waht is the implication?</p>\n<p>how about the reverse? mislabelled pos as neg?</p>",
          "rawMarkdown": "i suddenly have interesting question. maybe someone can take this as future research.\nif i purposely mislabelled a negative image as positive for training, what would the CAM heatmap show? waht is the implication?\n\nhow about the reverse? mislabelled pos as neg?",
          "replies": [
            {
              "id": 2152260,
              "postDate": "2023-02-20T17:17:00.357Z",
              "content": "<p>if may be difficult to apply multi-view learning, but you can transfer/distill knowledge via manual annotation !!!!</p>\n<p><img src=\"https://i.ibb.co/56jy09J/Selection-999-843.png\" alt=\"https://i.ibb.co/56jy09J/Selection-999-843.png\"></p>",
              "rawMarkdown": "if may be difficult to apply multi-view learning, but you can transfer/distill knowledge via manual annotation !!!!\n\n\n![https://i.ibb.co/56jy09J/Selection-999-843.png](https://i.ibb.co/56jy09J/Selection-999-843.png)"
            }
          ]
        }
      ]
    },
    {
      "id": 2111985,
      "postDate": "2023-01-23T10:41:24.170Z",
      "content": "<p>i started some experiments on multi-view. this is very tricky as you are basically reducing your train and validation data since it now become </p>\n<pre><code>num of train data = num of original train data / num of view\n</code></pre>",
      "rawMarkdown": "i started some experiments on multi-view. this is very tricky as you are basically reducing your train and validation data since it now become \n```\nnum of train data = num of original train data / num of view\n```",
      "votes": 1,
      "replies": [
        {
          "id": 2146523,
          "postDate": "2023-02-16T00:27:47.087Z",
          "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> <br>\nThanks for this really useful and interesting discussion. By the way, have models on multi-view worked well?</p>",
          "rawMarkdown": "@hengck23 \nThanks for this really useful and interesting discussion. By the way, have models on multi-view worked well?"
        }
      ]
    },
    {
      "id": 2104723,
      "postDate": "2023-01-18T01:51:02.153Z",
      "content": "<p>i haven try this but 2 ideas work for finetunning NLP transformers may work here</p>\n<ol>\n<li>adversarial training (fast sign gradient method, etc)</li>\n<li>Sharpness-Aware Minimization (SAM)</li>\n</ol>\n<p>both method try to flatten the valley of the resulting loss landscape to imporve robustenss and fight overfitting.<br>\n(or in the input space sense, try to create virtual neighbours for each train samples)</p>\n<p>reference<br>\n<a href=\"https://github.com/juntang-zhuang/GSAM\" target=\"_blank\">https://github.com/juntang-zhuang/GSAM</a>   </p>\n<p>DeBERTa: Decoding-enhanced BERT with Disentangled Attention<br>\n<a href=\"https://arxiv.org/abs/2006.03654\" target=\"_blank\">https://arxiv.org/abs/2006.03654</a><br>\n\"In addition, a new virtual adversarial training method is used for fine-tuning to improve models' generalization. We show that these techniques significantly improve the efficiency of model pre-training and the performance of both natural language understanding\"<br>\n<a href=\"https://github.com/microsoft/DeBERTa/blob/master/DeBERTa/sift/sift.py\" target=\"_blank\">https://github.com/microsoft/DeBERTa/blob/master/DeBERTa/sift/sift.py</a></p>",
      "rawMarkdown": "i haven try this but 2 ideas work for finetunning NLP transformers may work here\n1. adversarial training (fast sign gradient method, etc)\n2.  Sharpness-Aware Minimization (SAM)\n\nboth method try to flatten the valley of the resulting loss landscape to imporve robustenss and fight overfitting.\n(or in the input space sense, try to create virtual neighbours for each train samples)\n\nreference\nhttps://github.com/juntang-zhuang/GSAM   \n\nDeBERTa: Decoding-enhanced BERT with Disentangled Attention\nhttps://arxiv.org/abs/2006.03654\n\"In addition, a new virtual adversarial training method is used for fine-tuning to improve models' generalization. We show that these techniques significantly improve the efficiency of model pre-training and the performance of both natural language understanding\"\nhttps://github.com/microsoft/DeBERTa/blob/master/DeBERTa/sift/sift.py",
      "votes": 1,
      "replies": [
        {
          "id": 2104725,
          "postDate": "2023-01-18T01:55:38.320Z",
          "content": "<p>Have you read \"<a href=\"https://arxiv.org/abs/2208.06066\" target=\"_blank\">Deep is a Luxury We Don't Have</a>\"? They improve on the GMIC arch and show that ASAM improves generalization. Results look good and <a href=\"https://github.com/whiterabbit-ai/hct\" target=\"_blank\">code is released</a> but its under a company so I doubt weights would be released.</p>",
          "rawMarkdown": "Have you read \"[Deep is a Luxury We Don't Have](https://arxiv.org/abs/2208.06066)\"? They improve on the GMIC arch and show that ASAM improves generalization. Results look good and [code is released](https://github.com/whiterabbit-ai/hct) but its under a company so I doubt weights would be released.",
          "votes": 1,
          "replies": [
            {
              "id": 2105192,
              "postDate": "2023-01-18T10:47:57.453Z",
              "content": "<p>I have tried it and failed to achieve AUC &gt; 0.75 on kaggle dataset</p>\n<p>Also it takes a long time to load images in 3k resolution, <br>\nso you will have to either wait couple of days or implement DALI loading pipeline</p>\n<p>The reason I think is that there is no pretrained weights and kaggle dataset is rather small to use networks without pretraining, but if I remember correctly their neural net on 3k resolution &amp; batch 16 takes only 10Gb of GPU VRAM with amp, so you can give it a try</p>",
              "rawMarkdown": "I have tried it and failed to achieve AUC > 0.75 on kaggle dataset\n\nAlso it takes a long time to load images in 3k resolution, \nso you will have to either wait couple of days or implement DALI loading pipeline\n\nThe reason I think is that there is no pretrained weights and kaggle dataset is rather small to use networks without pretraining, but if I remember correctly their neural net on 3k resolution & batch 16 takes only 10Gb of GPU VRAM with amp, so you can give it a try"
            },
            {
              "id": 2105370,
              "postDate": "2023-01-18T13:04:50.827Z",
              "content": "<p>Yeah without weights I don't expect it to produce good results for our uses but the paper is a good read and I learned a lot of new things. My experience with GMIC isn't well either, I think with the same resolution I only got to AUC ~ .85 single image but the recall wasn't great so my F1 score was about .3~4. </p>",
              "rawMarkdown": "Yeah without weights I don't expect it to produce good results for our uses but the paper is a good read and I learned a lot of new things. My experience with GMIC isn't well either, I think with the same resolution I only got to AUC ~ .85 single image but the recall wasn't great so my F1 score was about .3~4. "
            }
          ]
        }
      ]
    },
    {
      "id": 2079089,
      "postDate": "2022-12-29T01:20:09.167Z",
      "content": "<p>to crop or not to crop<br>\n<a href=\"https://ibb.co/Y8Lymrt\"><img src=\"https://i.ibb.co/pZLRcm3/Selection-334.png\" alt=\"Selection-334\"></a></p>",
      "rawMarkdown": "to crop or not to crop\n<a href=\"https://ibb.co/Y8Lymrt\"><img src=\"https://i.ibb.co/pZLRcm3/Selection-334.png\" alt=\"Selection-334\" border=\"0\"></a>",
      "votes": 1
    },
    {
      "id": 2074114,
      "postDate": "2022-12-23T18:07:27.113Z",
      "content": "<p><img src=\"https://i.ibb.co/Z8kbcqx/Selection-273.png\" alt=\"https://i.ibb.co/Z8kbcqx/Selection-273.png\"><br>\ni wonder if we have enough data for transformer solution</p>",
      "rawMarkdown": "![https://i.ibb.co/Z8kbcqx/Selection-273.png](https://i.ibb.co/Z8kbcqx/Selection-273.png)\ni wonder if we have enough data for transformer solution",
      "votes": 1,
      "replies": [
        {
          "id": 2074131,
          "postDate": "2022-12-23T18:29:45.433Z",
          "content": "<p>modified from gigapixel transformer paper<br>\n<a href=\"https://paperswithcode.com/paper/scaling-vision-transformers-to-gigapixel-1\" target=\"_blank\">https://paperswithcode.com/paper/scaling-vision-transformers-to-gigapixel-1</a></p>\n<p><img src=\"https://i.ibb.co/tZ680Lr/Selection-275.png\" alt=\"https://i.ibb.co/tZ680Lr/Selection-275.png\"></p>",
          "rawMarkdown": "modified from gigapixel transformer paper\nhttps://paperswithcode.com/paper/scaling-vision-transformers-to-gigapixel-1\n\n![https://i.ibb.co/tZ680Lr/Selection-275.png](https://i.ibb.co/tZ680Lr/Selection-275.png)",
          "votes": 2,
          "replies": [
            {
              "id": 2074138,
              "postDate": "2022-12-23T18:47:43.300Z",
              "content": "<p><img src=\"https://i.ibb.co/3NQ7L1Y/Selection-278.png\" alt=\"https://i.ibb.co/3NQ7L1Y/Selection-278.png\"></p>\n<p>probably useful to detect asymmetry abnormality between left and right</p>",
              "rawMarkdown": "![https://i.ibb.co/3NQ7L1Y/Selection-278.png](https://i.ibb.co/3NQ7L1Y/Selection-278.png)\n\nprobably useful to detect asymmetry abnormality between left and right\n"
            },
            {
              "id": 2074142,
              "postDate": "2022-12-23T19:03:14.740Z",
              "content": "<p>What do you think about AE (trained only on background) and then using it for anomaly detection? I think that for each cancer photo loss should be higher then for background. </p>",
              "rawMarkdown": "What do you think about AE (trained only on background) and then using it for anomaly detection? I think that for each cancer photo loss should be higher then for background. "
            },
            {
              "id": 2074275,
              "postDate": "2022-12-23T23:58:37.477Z",
              "content": "<p>this are some smiliar work on this:<br>\n<a href=\"https://www.nature.com/articles/s41598-021-89626-1\" target=\"_blank\">https://www.nature.com/articles/s41598-021-89626-1</a><br>\n<img src=\"https://i.ibb.co/kKjCsS4/Selection-279.png\" alt=\"https://i.ibb.co/kKjCsS4/Selection-279.png\"></p>\n<p>masked image modeling (aka, masked token pretraining for transformer e.g. <a href=\"https://github.com/facebookresearch/mae\" target=\"_blank\">https://github.com/facebookresearch/mae</a>) are essentially auto encoders. you can try that</p>\n<p>Unsupervised Anomaly Detection in Medical Images with a Memory-augmented Multi-level Cross-attentional Masked Autoencoder<br>\n<a href=\"https://yutianyt.com/publications/\" target=\"_blank\">https://yutianyt.com/publications/</a></p>",
              "rawMarkdown": "this are some smiliar work on this:\nhttps://www.nature.com/articles/s41598-021-89626-1\n![https://i.ibb.co/kKjCsS4/Selection-279.png](https://i.ibb.co/kKjCsS4/Selection-279.png)\n\nmasked image modeling (aka, masked token pretraining for transformer e.g. https://github.com/facebookresearch/mae) are essentially auto encoders. you can try that\n\n\nUnsupervised Anomaly Detection in Medical Images with a Memory-augmented Multi-level Cross-attentional Masked Autoencoder\nhttps://yutianyt.com/publications/"
            },
            {
              "id": 2074300,
              "postDate": "2022-12-24T00:44:41.017Z",
              "content": "<p>another great work<br>\nMulti-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation<br>\n<a href=\"https://yutianyt.com/publications/\" target=\"_blank\">https://yutianyt.com/publications/</a></p>",
              "rawMarkdown": "another great work\nMulti-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation\nhttps://yutianyt.com/publications/\n"
            },
            {
              "id": 2074533,
              "postDate": "2022-12-24T09:37:10.717Z",
              "content": "<p><img src=\"https://i.ibb.co/sjtJqnL/iRPE.png\" alt=\"https://i.ibb.co/sjtJqnL/iRPE.png\"><br>\n<a href=\"https://houwenpeng.com/publication.html\" target=\"_blank\">https://houwenpeng.com/publication.html</a></p>\n<p>Rethinking and Improving Relative Position Encoding for Vision Transformer</p>",
              "rawMarkdown": "![https://i.ibb.co/sjtJqnL/iRPE.png](https://i.ibb.co/sjtJqnL/iRPE.png)\nhttps://houwenpeng.com/publication.html\n\nRethinking and Improving Relative Position Encoding for Vision Transformer"
            },
            {
              "id": 2075578,
              "postDate": "2022-12-25T15:50:59.347Z",
              "content": "<p>example code and implementation</p>\n<p><a href=\"https://ibb.co/smwNRxH\"><img src=\"https://i.ibb.co/LktcRj5/Selection-293.png\" alt=\"Selection-293\"></a><br>\n<a href=\"https://ibb.co/0JkLXBc\"><img src=\"https://i.ibb.co/h8kNMXy/Selection-291.png\" alt=\"Selection-291\"></a><br>\n<a href=\"https://ibb.co/10pGT4m\"><img src=\"https://i.ibb.co/D16fQjR/Selection-292.png\" alt=\"Selection-292\"></a></p>\n<hr>\n<p><a href=\"https://ibb.co/99XWd0W\"><img src=\"https://i.ibb.co/7JcK0DK/Selection-294.png\" alt=\"Selection-294\"></a></p>",
              "rawMarkdown": "example code and implementation\n\n<a href=\"https://ibb.co/smwNRxH\"><img src=\"https://i.ibb.co/LktcRj5/Selection-293.png\" alt=\"Selection-293\" border=\"0\"></a>\n<a href=\"https://ibb.co/0JkLXBc\"><img src=\"https://i.ibb.co/h8kNMXy/Selection-291.png\" alt=\"Selection-291\" border=\"0\"></a>\n<a href=\"https://ibb.co/10pGT4m\"><img src=\"https://i.ibb.co/D16fQjR/Selection-292.png\" alt=\"Selection-292\" border=\"0\"></a>\n\n---\n<a href=\"https://ibb.co/99XWd0W\"><img src=\"https://i.ibb.co/7JcK0DK/Selection-294.png\" alt=\"Selection-294\" border=\"0\"></a>",
              "votes": 2
            },
            {
              "id": 2075587,
              "postDate": "2022-12-25T16:09:41.920Z",
              "content": "<p>Looks great! I am working now on AE using ViT (as a decoder). Hope next week will be ready for tests.</p>",
              "rawMarkdown": "Looks great! I am working now on AE using ViT (as a decoder). Hope next week will be ready for tests.",
              "votes": 1
            },
            {
              "id": 2079075,
              "postDate": "2022-12-29T00:30:06Z",
              "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> </p>\n<p>i find a paper that does auto encoder (reconstruction loss)<img src=\"https://i.ibb.co/Mk3T27y/Selection-326.png\" alt=\"https://i.ibb.co/Mk3T27y/Selection-326.png\"></p>\n<p><a href=\"https://www.frontiersin.org/articles/10.3389/fradi.2021.796078/full\" target=\"_blank\">https://www.frontiersin.org/articles/10.3389/fradi.2021.796078/full</a></p>\n<ul>\n<li>it also compare results with nyu classifier</li>\n<li>it introduce a new dataset <a href=\"https://virtualtissuebank.iu.edu/\" target=\"_blank\">https://virtualtissuebank.iu.edu/</a></li>\n</ul>",
              "rawMarkdown": "@remekkinas \n\ni find a paper that does auto encoder (reconstruction loss)![https://i.ibb.co/Mk3T27y/Selection-326.png] (https://i.ibb.co/Mk3T27y/Selection-326.png)\n\nhttps://www.frontiersin.org/articles/10.3389/fradi.2021.796078/full\n\n- it also compare results with nyu classifier\n- it introduce a new dataset https://virtualtissuebank.iu.edu/",
              "votes": 2
            },
            {
              "id": 2079476,
              "postDate": "2022-12-29T10:47:41.830Z",
              "content": "<p>Thank you very much for providing this publication. I will read it. <br>\nNow I am developing AE. The main idea is:</p>\n<ul>\n<li>split image into patches and augment them with positional embedding</li>\n<li>output sequence is fed to the transformer  encoder</li>\n<li>encoded features are summed into a reconstruction vector </li>\n<li>reconstruction vector is fed to decoder</li>\n<li>encoded features are fed into an Gaussian approximation network</li>\n</ul>\n<p>Still work on dataset as well. </p>",
              "rawMarkdown": "Thank you very much for providing this publication. I will read it. \nNow I am developing AE. The main idea is:\n- split image into patches and augment them with positional embedding\n- output sequence is fed to the transformer  encoder\n- encoded features are summed into a reconstruction vector \n- reconstruction vector is fed to decoder\n- encoded features are fed into an Gaussian approximation network\n\nStill work on dataset as well. "
            },
            {
              "id": 2079629,
              "postDate": "2022-12-29T14:03:14.140Z",
              "content": "<p>Are you doing multi-task learning or just plugging in pretrained heads to your model? <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> </p>",
              "rawMarkdown": "Are you doing multi-task learning or just plugging in pretrained heads to your model? @hengck23 "
            },
            {
              "id": 2082758,
              "postDate": "2023-01-01T22:28:38.853Z",
              "content": "<p>\"Specifically, a well-trained Auto-Encoder (AE) is employed to explore common anatomical structures from large sets of mammographic images with weak annotations. Moreover, to push forward segmentation performance, KD is introduced to transfer anatomy features representation ability from the AE (Teacher) to the segmentation network, i.e., U-Net (Student) so that the segmentation network becomes more sensitive to other anatomy structures when the available data is limited.\"</p>\n<p><a href=\"https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0256830\" target=\"_blank\">https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0256830</a><br>\nAAWS-Net: Anatomy-aware weakly-supervised learning network for breast mass segmentation</p>\n<p><img src=\"https://i.ibb.co/qBBhsty/journal-pone-0256830-g001.png\" alt=\"https://i.ibb.co/qBBhsty/journal-pone-0256830-g001.png\"></p>",
              "rawMarkdown": "\"Specifically, a well-trained Auto-Encoder (AE) is employed to explore common anatomical structures from large sets of mammographic images with weak annotations. Moreover, to push forward segmentation performance, KD is introduced to transfer anatomy features representation ability from the AE (Teacher) to the segmentation network, i.e., U-Net (Student) so that the segmentation network becomes more sensitive to other anatomy structures when the available data is limited.\"\n\nhttps://journals.plos.org/plosone/article?id=10.1371/journal.pone.0256830\nAAWS-Net: Anatomy-aware weakly-supervised learning network for breast mass segmentation\n\n![https://i.ibb.co/qBBhsty/journal-pone-0256830-g001.png](https://i.ibb.co/qBBhsty/journal-pone-0256830-g001.png)\n\n\n",
              "votes": 1
            }
          ]
        },
        {
          "id": 2081351,
          "postDate": "2022-12-31T04:58:42.020Z",
          "content": "<p>Hi, could u please tell me which paper is this image from? thx:)</p>",
          "rawMarkdown": "Hi, could u please tell me which paper is this image from? thx:)"
        }
      ]
    },
    {
      "id": 2072979,
      "postDate": "2022-12-22T15:00:21.430Z",
      "content": "<p>should the threshold for f1score binarisation varies with breast density (and/or BI-RADS)?</p>",
      "rawMarkdown": "should the threshold for f1score binarisation varies with breast density (and/or BI-RADS)?",
      "votes": 1,
      "replies": [
        {
          "id": 2073046,
          "postDate": "2022-12-22T16:08:41.213Z",
          "content": "<p>It should, the threshold will change with models predictions, and since predictions themselves can be in different ranges, ranges which could vary with change in breast density and BI-RADS, I think variation of BI-RADS will have more effect than breast density, although needs further testing</p>",
          "rawMarkdown": "It should, the threshold will change with models predictions, and since predictions themselves can be in different ranges, ranges which could vary with change in breast density and BI-RADS, I think variation of BI-RADS will have more effect than breast density, although needs further testing",
          "votes": 1
        }
      ]
    },
    {
      "id": 2146431,
      "postDate": "2023-02-15T21:31:24.823Z",
      "content": "<p>i find some direct differentiable loss for AUC-PR and Fbeta score.<br>\n(in pytorch and tensorflow)</p>\n<p>the idea is simple.<br>\nyou  find surrogate function for FPR and TPR, which have to learn the a \"threshold parameter\" <br>\nFPR, TPR themselves are function of a deep net, which have  \"net parameter\"  </p>\n<p>so the optimization become a min, max problem for  \"threshold parameter\"  and   \"net parameter\" <br>\nyou can solved it via sdg with weighted classification loss<br>\n(or you can solve in globally using linear programming)</p>\n<p>paper:<br>\n<a href=\"https://github.com/Shlomix/global_objectives_pytorch/\" target=\"_blank\">https://github.com/Shlomix/global_objectives_pytorch/</a><br>\n<a href=\"https://github.com/facebookresearch/pytext/blob/main/pytext/loss/loss.py\" target=\"_blank\">https://github.com/facebookresearch/pytext/blob/main/pytext/loss/loss.py</a></p>\n<p>paper:<br>\n[1] Scalable Learning of Non-Decomposable Objectives<br>\n<a href=\"https://arxiv.org/abs/1608.04802\" target=\"_blank\">https://arxiv.org/abs/1608.04802</a></p>\n<hr>\n<p>but we have an issue of imbalance. so i not sure if the method would work as well.</p>",
      "rawMarkdown": "i find some direct differentiable loss for AUC-PR and Fbeta score.\n(in pytorch and tensorflow)\n\nthe idea is simple.\nyou  find surrogate function for FPR and TPR, which have to learn the a \"threshold parameter\" \nFPR, TPR themselves are function of a deep net, which have  \"net parameter\"  \n\nso the optimization become a min, max problem for  \"threshold parameter\"  and   \"net parameter\" \nyou can solved it via sdg with weighted classification loss\n(or you can solve in globally using linear programming)\n\npaper:\nhttps://github.com/Shlomix/global_objectives_pytorch/\nhttps://github.com/facebookresearch/pytext/blob/main/pytext/loss/loss.py\n\n\n\npaper:\n[1] Scalable Learning of Non-Decomposable Objectives\nhttps://arxiv.org/abs/1608.04802\n\n\n---\n\nbut we have an issue of imbalance. so i not sure if the method would work as well.",
      "votes": 2
    },
    {
      "id": 2058060,
      "postDate": "2022-12-07T15:38:48.123Z",
      "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> Your CV/LB gap seems huge. I'm having ~0.01 difference.<br>\nAny idea why ?</p>\n<p>EDIT : Fixed a bug in my inference pipeline, I have a huge CV/LB gap as well now  (0.04)</p>",
      "rawMarkdown": "@hengck23 Your CV/LB gap seems huge. I'm having ~0.01 difference.\nAny idea why ?\n\nEDIT : Fixed a bug in my inference pipeline, I have a huge CV/LB gap as well now  (0.04)",
      "votes": 1,
      "replies": [
        {
          "id": 2058101,
          "postDate": "2022-12-07T16:04:02.807Z",
          "content": "<p>Is he showing it?  I see LB scores for the ensemble but no CV.  He's updating the image quite a bit though, so maybe we're looking at something different.</p>",
          "rawMarkdown": "Is he showing it?  I see LB scores for the ensemble but no CV.  He's updating the image quite a bit though, so maybe we're looking at something different."
        },
        {
          "id": 2058123,
          "postDate": "2022-12-07T16:20:58.453Z",
          "content": "<p>I think the <code>binarised - max pfbeta</code> column is his local validation score</p>",
          "rawMarkdown": "I think the `binarised - max pfbeta` column is his local validation score"
        },
        {
          "id": 2058315,
          "postDate": "2022-12-07T19:39:55.167Z",
          "content": "<p>Theo, I think <a href=\"https://www.kaggle.com/threshold\" target=\"_blank\">@threshold</a> might be the cv? If you look at some of the other images, he has some largish numbers reported for <a href=\"https://www.kaggle.com/threshold\" target=\"_blank\">@threshold</a> (eg, .632)</p>",
          "rawMarkdown": "Theo, I think @threshold might be the cv? If you look at some of the other images, he has some largish numbers reported for @threshold (eg, .632)"
        },
        {
          "id": 2058319,
          "postDate": "2022-12-07T19:48:44.137Z",
          "content": "<p>\"binarised - max pfbeta\" is the local CV.<br>\n\"@threshold \" is the threshold value where max occur.</p>\n<p>there are different ways to aggregate and threshold:<br>\ne.g.  threshold then aggregate, or aggregate then threshold</p>\n<p>these methods are not optimal. the best method is to learn to predict from multiple views (e.g. cross-view attention, lstm, etc)</p>",
          "rawMarkdown": "\"binarised - max pfbeta\" is the local CV.\n\"@threshold \" is the threshold value where max occur.\n\nthere are different ways to aggregate and threshold:\ne.g.  threshold then aggregate, or aggregate then threshold\n\nthese methods are not optimal. the best method is to learn to predict from multiple views (e.g. cross-view attention, lstm, etc)",
          "votes": 1
        },
        {
          "id": 2059050,
          "postDate": "2022-12-08T12:34:10.270Z",
          "content": "<p>Thank you for your analysis and updates. Could you please clarify what you mean about the order of aggregate and threshold? If that's a max followed by thresh how come is different the other way around? Maybe I'm mistaken.</p>",
          "rawMarkdown": "Thank you for your analysis and updates. Could you please clarify what you mean about the order of aggregate and threshold? If that's a max followed by thresh how come is different the other way around? Maybe I'm mistaken."
        },
        {
          "id": 2065448,
          "postDate": "2022-12-14T17:04:39.113Z",
          "content": "<p><a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a> </p>\n<p>\"@hengck23 Your CV/LB gap seems huge. I'm having ~0.01 difference.<br>\nAny idea why ?\"</p>\n<p>i confirm this is due to different sampling, loss, post-processing (recalibration) strategy</p>",
          "rawMarkdown": "@theoviel \n\n\"@hengck23 Your CV/LB gap seems huge. I'm having ~0.01 difference.\nAny idea why ?\"\n\ni confirm this is due to different sampling, loss, post-processing (recalibration) strategy",
          "votes": 1
        }
      ]
    },
    {
      "id": 2056581,
      "postDate": "2022-12-06T09:10:50.410Z",
      "content": "<p>Thank You for sharing <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> Always Appreciated!</p>",
      "rawMarkdown": "Thank You for sharing @hengck23 Always Appreciated!",
      "votes": 1
    },
    {
      "id": 2100897,
      "postDate": "2023-01-15T13:35:39.203Z",
      "content": "<p>i made a bug and notebbok gets into infinite loop at submission.<br>\nthis eats up my GPU hours at the beginning of the week and was unable to verify the trick below.</p>\n<hr>\n<p>the reshaping of power 0.5 trick consistently improves my CV by 0.01<br>\nKagglers may want to verify this for LB.</p>\n<pre><code>before\n    valid_df.loc[:, 'cancer_p'] = cancer_p\n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n\n\nafter\n    valid_df.loc[:, 'cancer_p'] = cancer_p**0.5 \n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n</code></pre>",
      "rawMarkdown": "i made a bug and notebbok gets into infinite loop at submission.\nthis eats up my GPU hours at the beginning of the week and was unable to verify the trick below.\n\n----\n\nthe reshaping of power 0.5 trick consistently improves my CV by 0.01\nKagglers may want to verify this for LB.\n\n\n```\nbefore\n    valid_df.loc[:, 'cancer_p'] = cancer_p\n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n\n\nafter\n    valid_df.loc[:, 'cancer_p'] = cancer_p**0.5 \n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n\n```\n\n",
      "votes": 2
    },
    {
      "id": 2098125,
      "postDate": "2023-01-13T08:52:42.823Z",
      "content": "<p>keep only the most important patch!<br>\nWACV2023 paper<br>\n<a href=\"https://github.com/yueliukth/PatchDropout\" target=\"_blank\">https://github.com/yueliukth/PatchDropout</a></p>\n<p><img src=\"https://i.ibb.co/8YpxJGS/Selection-518.png\" alt=\"https://i.ibb.co/8YpxJGS/Selection-518.png\"></p>\n<p>[1] PatchDropout: Economizing Vision Transformers Using Patch Dropout<br>\n<a href=\"https://openaccess.thecvf.com/content/WACV2023/papers/Liu_PatchDropout_Economizing_Vision_Transformers_Using_Patch_Dropout_WACV_2023_paper.pdf\" target=\"_blank\">https://openaccess.thecvf.com/content/WACV2023/papers/Liu_PatchDropout_Economizing_Vision_Transformers_Using_Patch_Dropout_WACV_2023_paper.pdf</a></p>",
      "rawMarkdown": "keep only the most important patch!\nWACV2023 paper\nhttps://github.com/yueliukth/PatchDropout\n\n![https://i.ibb.co/8YpxJGS/Selection-518.png](https://i.ibb.co/8YpxJGS/Selection-518.png)\n\n[1] PatchDropout: Economizing Vision Transformers Using Patch Dropout\nhttps://openaccess.thecvf.com/content/WACV2023/papers/Liu_PatchDropout_Economizing_Vision_Transformers_Using_Patch_Dropout_WACV_2023_paper.pdf\n\n",
      "votes": 2
    },
    {
      "id": 2085513,
      "postDate": "2023-01-04T07:48:47.687Z",
      "content": "<p>seems that site1 and site 2 are biased. do we need to separate them?</p>\n<p>see bottom of notebook<br>\n<a href=\"https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset/notebook\" target=\"_blank\">https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset/notebook</a></p>\n<p>\"there is starter code of baseline pure efficient-b0 single view here: https://www.kaggle.com/datasets/hengck23/pure-effb0-single-view-starter-for-mvccl-admani\"</p>",
      "rawMarkdown": "seems that site1 and site 2 are biased. do we need to separate them?\n\nsee bottom of notebook\nhttps://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset/notebook\n\n\"there is starter code of baseline pure efficient-b0 single view here: https://www.kaggle.com/datasets/hengck23/pure-effb0-single-view-starter-for-mvccl-admani\"",
      "votes": 2,
      "replies": [
        {
          "id": 2086357,
          "postDate": "2023-01-04T18:12:36.467Z",
          "content": "<p>Hey, I noticed in this notebook the GCM has only 1 mapping function when the paper describes two for each view. I think I am missing something but shouldn't these be two different functions rather than one projection function? It wouldn't make sense to me that g_m can be mapped back to itself with the same function</p>\n<p>EDIT: I know the paper is vague about it but I'll experiment with both and see.</p>",
          "rawMarkdown": "Hey, I noticed in this notebook the GCM has only 1 mapping function when the paper describes two for each view. I think I am missing something but shouldn't these be two different functions rather than one projection function? It wouldn't make sense to me that g_m can be mapped back to itself with the same function\n\nEDIT: I know the paper is vague about it but I'll experiment with both and see.",
          "votes": 1,
          "replies": [
            {
              "id": 2086521,
              "postDate": "2023-01-04T20:17:42.310Z",
              "content": "<p>you can also try</p>\n<pre><code>a = W*b\nb =inv(W)*a\n</code></pre>",
              "rawMarkdown": "you can also try\n\n\n```\na = W*b\nb =inv(W)*a\n\n```",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2080577,
      "postDate": "2022-12-30T09:29:13.020Z",
      "content": "<p>cross-view attention and transformer</p>\n<p><a href=\"https://ibb.co/ZXNC7rg\"><img src=\"https://i.ibb.co/Rb7WdK6/Selection-383.png\" alt=\"Selection-383\"></a><br>\n<a href=\"https://ibb.co/KzbfwFW\"><img src=\"https://i.ibb.co/M5Zt6M7/Selection-382.png\" alt=\"Selection-382\"></a><br>\n<a href=\"https://ibb.co/ZmsNWbr\"><img src=\"https://i.ibb.co/wsHYM2q/Selection-381.png\" alt=\"Selection-381\"></a><br><a target=\"_blank\" href=\"https://imgbb.com/\">online free hosting</a><br></p>\n<p>[1] <a href=\"https://conferences.miccai.org/2022/papers/523-Paper1238.html\" target=\"_blank\">https://conferences.miccai.org/2022/papers/523-Paper1238.html</a><br>\n[2] <a href=\"https://arxiv.org/pdf/2103.11390.pdf\" target=\"_blank\">https://arxiv.org/pdf/2103.11390.pdf</a></p>",
      "rawMarkdown": "cross-view attention and transformer\n\n<a href=\"https://ibb.co/ZXNC7rg\"><img src=\"https://i.ibb.co/Rb7WdK6/Selection-383.png\" alt=\"Selection-383\" border=\"0\"></a>\n<a href=\"https://ibb.co/KzbfwFW\"><img src=\"https://i.ibb.co/M5Zt6M7/Selection-382.png\" alt=\"Selection-382\" border=\"0\"></a>\n<a href=\"https://ibb.co/ZmsNWbr\"><img src=\"https://i.ibb.co/wsHYM2q/Selection-381.png\" alt=\"Selection-381\" border=\"0\"></a><br /><a target='_blank' href='https://imgbb.com/'>online free hosting</a><br />\n\n[1] https://conferences.miccai.org/2022/papers/523-Paper1238.html\n[2] https://arxiv.org/pdf/2103.11390.pdf\n\n",
      "votes": 2
    },
    {
      "id": 2075918,
      "postDate": "2022-12-26T02:09:50.057Z",
      "content": "<p>it seems that you can simply flip (standardize to L)  and stack the images for alignment<br>\nall images are aligned to the common detected nipple point</p>\n<p><img src=\"https://i.ibb.co/Q7BhwpN/Selection-300.png\" alt=\"https://i.ibb.co/Q7BhwpN/Selection-300.png\"></p>\n<p>related: [1] MommiNet-v2: Mammographic multi-view mass identification networks</p>",
      "rawMarkdown": "it seems that you can simply flip (standardize to L)  and stack the images for alignment\nall images are aligned to the common detected nipple point\n\n![https://i.ibb.co/Q7BhwpN/Selection-300.png](https://i.ibb.co/Q7BhwpN/Selection-300.png)\n\nrelated: [1] MommiNet-v2: Mammographic multi-view mass identification networks\n",
      "votes": 2,
      "replies": [
        {
          "id": 2075923,
          "postDate": "2022-12-26T02:19:42.067Z",
          "content": "<p>In some of the photos, I noticed that the \"nipple\" point is actually also marked on the image with a circle. I am guessing that is used for the alignment. </p>",
          "rawMarkdown": "In some of the photos, I noticed that the \"nipple\" point is actually also marked on the image with a circle. I am guessing that is used for the alignment. "
        },
        {
          "id": 2076621,
          "postDate": "2022-12-26T16:31:07.023Z",
          "content": "<p>check this work as well for using stacking as alignment</p>\n<p><a href=\"https://arxiv.org/pdf/1907.13057.pdf\" target=\"_blank\">https://arxiv.org/pdf/1907.13057.pdf</a></p>",
          "rawMarkdown": "check this work as well for using stacking as alignment\n\nhttps://arxiv.org/pdf/1907.13057.pdf",
          "votes": 1
        }
      ]
    },
    {
      "id": 2073809,
      "postDate": "2022-12-23T12:55:20.397Z",
      "content": "<p><img src=\"https://i.ibb.co/PZffjtW/Selection-270.png\" alt=\"https://i.ibb.co/PZffjtW/Selection-270.png\"><br>\ninteresting results:<br>\nprediction on kaggle dataset using models trained on different external data</p>",
      "rawMarkdown": "![https://i.ibb.co/PZffjtW/Selection-270.png](https://i.ibb.co/PZffjtW/Selection-270.png)\ninteresting results:\nprediction on kaggle dataset using models trained on different external data",
      "votes": 2,
      "replies": [
        {
          "id": 2073820,
          "postDate": "2022-12-23T12:58:08.460Z",
          "content": "<p>Really great topic you created! 👍<br>\nI have learned from this topic a lot. </p>\n<p>Is it Grad-CAM or Activation map?</p>",
          "rawMarkdown": "Really great topic you created! 👍\nI have learned from this topic a lot. \n\nIs it Grad-CAM or Activation map?",
          "votes": 2,
          "replies": [
            {
              "id": 2073822,
              "postDate": "2022-12-23T12:59:17.480Z",
              "content": "<p>segmentation (1/32 scaled heatmap)results</p>",
              "rawMarkdown": "segmentation (1/32 scaled heatmap)results",
              "votes": 1
            }
          ]
        },
        {
          "id": 2082383,
          "postDate": "2023-01-01T14:12:24.840Z",
          "content": "<p>Did you train on external data on your own or use pretrained models?</p>",
          "rawMarkdown": "Did you train on external data on your own or use pretrained models?"
        }
      ]
    },
    {
      "id": 2072341,
      "postDate": "2022-12-22T01:35:13.687Z",
      "content": "<p>some external data results</p>\n<p><a href=\"https://ibb.co/jftqy2P\"><img src=\"https://i.ibb.co/yP2K61c/Selection-254.png\" alt=\"Selection-254\"></a><br>\n<a href=\"https://ibb.co/xjXSdH5\"><img src=\"https://i.ibb.co/pzbv5yX/Selection-253.png\" alt=\"Selection-253\"></a><br>\n<a href=\"https://ibb.co/bvpkbcW\"><img src=\"https://i.ibb.co/jw7SJn6/Selection-252.png\" alt=\"Selection-252\"></a></p>",
      "rawMarkdown": "some external data results\n\n<a href=\"https://ibb.co/jftqy2P\"><img src=\"https://i.ibb.co/yP2K61c/Selection-254.png\" alt=\"Selection-254\" border=\"0\"></a>\n<a href=\"https://ibb.co/xjXSdH5\"><img src=\"https://i.ibb.co/pzbv5yX/Selection-253.png\" alt=\"Selection-253\" border=\"0\"></a>\n<a href=\"https://ibb.co/bvpkbcW\"><img src=\"https://i.ibb.co/jw7SJn6/Selection-252.png\" alt=\"Selection-252\" border=\"0\"></a>",
      "votes": 2,
      "replies": [
        {
          "id": 2072393,
          "postDate": "2022-12-22T04:35:48.613Z",
          "content": "<p>here is way external data could be the key:</p>\n<p><a href=\"https://ibb.co/3mTzvtF\"><img src=\"https://i.ibb.co/d4fgtnp/Selection-256.png\" alt=\"Selection-256\"></a></p>\n<p>another observation:<br>\nwhile it is difficult to learn some models (e.g. vision transformer, resnet (without se)) on image label on kaggle dataset, it is easy to use the same model to learn heatmap prediction with heatmap ground truth generated by hand or external model</p>",
          "rawMarkdown": "here is way external data could be the key:\n\n<a href=\"https://ibb.co/3mTzvtF\"><img src=\"https://i.ibb.co/d4fgtnp/Selection-256.png\" alt=\"Selection-256\" border=\"0\"></a>\n\nanother observation:\nwhile it is difficult to learn some models (e.g. vision transformer, resnet (without se)) on image label on kaggle dataset, it is easy to use the same model to learn heatmap prediction with heatmap ground truth generated by hand or external model",
          "replies": [
            {
              "id": 2072447,
              "postDate": "2022-12-22T05:41:03.653Z",
              "content": "<p>I am a bit new to DS, by heatmap do you mean like a segmentation model's raw output (not binarized)?</p>",
              "rawMarkdown": "I am a bit new to DS, by heatmap do you mean like a segmentation model's raw output (not binarized)?"
            },
            {
              "id": 2072462,
              "postDate": "2022-12-22T05:58:41.170Z",
              "content": "<p><a href=\"https://www.lri.fr/~gcharpia/deeppractice/2020/tpx_for_mva_dl_course_2020.pdf\" target=\"_blank\">https://www.lri.fr/~gcharpia/deeppractice/2020/tpx_for_mva_dl_course_2020.pdf</a><br>\n<img src=\"https://i.ibb.co/bvvzbHg/Selection-221.png\" alt=\"https://i.ibb.co/bvvzbHg/Selection-221.png\"></p>\n<p>the 11x16 output in the figure is the heatmap.</p>\n<p>on a side note:<br>\nHeatmap predictor can be trained using image crop (you need not use whole image). <br>\nHeatmap predictor can train on very high resolution (e.g. crops of 2048x2048).</p>\n<p>But if you enough memory, you can use whole image.</p>\n<p>Difference between segmentation and heatmap predictor is the output size. since we only need patch predictor and not pixel predictor, there is no decoder.</p>\n<p>but you can use a segmentation instead of heat predictor if you want</p>",
              "rawMarkdown": "https://www.lri.fr/~gcharpia/deeppractice/2020/tpx_for_mva_dl_course_2020.pdf\n![https://i.ibb.co/bvvzbHg/Selection-221.png](https://i.ibb.co/bvvzbHg/Selection-221.png)\n\nthe 11x16 output in the figure is the heatmap.\n\non a side note:\nHeatmap predictor can be trained using image crop (you need not use whole image). \nHeatmap predictor can train on very high resolution (e.g. crops of 2048x2048).\n\nBut if you enough memory, you can use whole image.\n\nDifference between segmentation and heatmap predictor is the output size. since we only need patch predictor and not pixel predictor, there is no decoder.\n\nbut you can use a segmentation instead of heat predictor if you want",
              "votes": 3
            },
            {
              "id": 2072506,
              "postDate": "2022-12-22T06:52:30.677Z",
              "content": "<p>One thing you need to keep an eye on if you're trying to win the comp is processing time.  It's a massive impediment in this comp due to the large # of images you have to infer on and the limited time you have.</p>\n<p>it's one of the reasons I'm looking at yolo so much.   It also has some really great stuff for training like automatic augmentation.  the wandb integration is pretty sweet as well.</p>\n<p>It's also a good reason to start looking into things like cython  .. I think the ability to do very optimal perf wise processing could be helpful here.</p>\n<p>I'd love to know if the time/perf constraint is a feature and not a bug of this comp.  And if it is a feature, what's the full reasoning behind it.</p>",
              "rawMarkdown": "One thing you need to keep an eye on if you're trying to win the comp is processing time.  It's a massive impediment in this comp due to the large # of images you have to infer on and the limited time you have.\n\nit's one of the reasons I'm looking at yolo so much.   It also has some really great stuff for training like automatic augmentation.  the wandb integration is pretty sweet as well.\n\nIt's also a good reason to start looking into things like cython  .. I think the ability to do very optimal perf wise processing could be helpful here.\n\nI'd love to know if the time/perf constraint is a feature and not a bug of this comp.  And if it is a feature, what's the full reasoning behind it."
            }
          ]
        }
      ]
    },
    {
      "id": 2150972,
      "postDate": "2023-02-19T18:00:04.150Z",
      "content": "<p>For me on CV 0.32 single fold with optimal th@0.5. I was expecting a much better result on LB as I've seen alot of kagglers wrote, but got only 0.34. Anyone has a clue of what is happening ?</p>",
      "rawMarkdown": "For me on CV 0.32 single fold with optimal th@0.5. I was expecting a much better result on LB as I've seen alot of kagglers wrote, but got only 0.34. Anyone has a clue of what is happening ?"
    },
    {
      "id": 2146941,
      "postDate": "2023-02-16T09:00:24.653Z",
      "content": "<p>there is something very strange about site1 and site2 data</p>\n<ul>\n<li>strong model seems to improve site2 (e.g. over 0.62) at the expense of dropping site1 (e.g. just over 0.30)</li>\n<li>mid strong model has bout 0.58 for site2 and 0.46 for site1</li>\n</ul>\n<p>i wonder did anyone try to train a classifier to discrminate site1 and site2. if the classiifer can differentiate them, then they are different.</p>\n<p>note that site2 has slightly more images. So it is possible that the model will take care of the majority site and sacrify the smaller one </p>",
      "rawMarkdown": "there is something very strange about site1 and site2 data\n- strong model seems to improve site2 (e.g. over 0.62) at the expense of dropping site1 (e.g. just over 0.30)\n- mid strong model has bout 0.58 for site2 and 0.46 for site1\n\ni wonder did anyone try to train a classifier to discrminate site1 and site2. if the classiifer can differentiate them, then they are different.\n\nnote that site2 has slightly more images. So it is possible that the model will take care of the majority site and sacrify the smaller one "
    },
    {
      "id": 2129867,
      "postDate": "2023-02-05T00:24:23.577Z",
      "content": "<p>Thank you for your contribution. <br>\nNoob question: (EfficientNetB2 and EfficientNetB4) are EfficientNet V1 or EfficientNetV2 ?     </p>",
      "rawMarkdown": "Thank you for your contribution. \nNoob question: (EfficientNetB2 and EfficientNetB4) are EfficientNet V1 or EfficientNetV2 ?     ",
      "replies": [
        {
          "id": 2130117,
          "postDate": "2023-02-05T06:44:36.543Z",
          "content": "<p>v1 👍</p>\n<p>(to little characters to post)</p>",
          "rawMarkdown": "v1 👍\n\n(to little characters to post)",
          "votes": 1
        }
      ]
    },
    {
      "id": 2129810,
      "postDate": "2023-02-04T22:17:54.337Z",
      "content": "<p>Thank you for your contribution 🙌<br>\n1, Could you explain the different between 2 metrics: \"pfbeta\" and \"max pfbeta\"? <br>\n2, In the \"aggregate by max() per patient-laterality\" part:<br>\nLet's take an example: In my valid set, I have 1000 patients, each patients has 4 images, 2 images for each \"patient-laterality\". <br>\n****So how pfbeta (logged to your table result) has calculated? **<br>\n**I guess: 1000 patients * 4 = 4000 images =&gt; 4000 proba predicted =&gt; max() for each patient-laterality -&gt; 2000 proba for 2000 (patient-laterality)s =&gt; 2000 pfbeta s for each (patient-laterality) -&gt; then take mean of them</p>\n<p>Thanks in advance </p>",
      "rawMarkdown": "Thank you for your contribution 🙌\n1, Could you explain the different between 2 metrics: \"pfbeta\" and \"max pfbeta\"? \n2, In the \"aggregate by max() per patient-laterality\" part:\nLet's take an example: In my valid set, I have 1000 patients, each patients has 4 images, 2 images for each \"patient-laterality\". \n****So how pfbeta (logged to your table result) has calculated? **\n**I guess: 1000 patients * 4 = 4000 images => 4000 proba predicted => max() for each patient-laterality -> 2000 proba for 2000 (patient-laterality)s => 2000 pfbeta s for each (patient-laterality) -> then take mean of them\n\nThanks in advance ",
      "replies": [
        {
          "id": 2130121,
          "postDate": "2023-02-05T06:46:24.800Z",
          "content": "<ol>\n<li>max, avg aggregation type</li>\n</ol>\n<pre><code>gb = site_df[['patient_id', 'laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n</code></pre>\n<pre><code>gb = site_df[['patient_id', 'laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).max()\n</code></pre>\n<p>where cancer_t is ground true, cancer_p is probalility of cancer. I am refering to script provided by <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> </p>\n<p>then metric (probf1score) is computed on gb dataframe</p>",
          "rawMarkdown": "1. max, avg aggregation type\n\n```\ngb = site_df[['patient_id', 'laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n```\n\n```\ngb = site_df[['patient_id', 'laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).max()\n```\n\nwhere cancer_t is ground true, cancer_p is probalility of cancer. I am refering to script provided by @hengck23 \n\nthen metric (probf1score) is computed on gb dataframe"
        }
      ]
    },
    {
      "id": 2123551,
      "postDate": "2023-01-31T15:21:07.247Z",
      "content": "<p>came across a question relevant to this kaggle competition</p>\n<p><img src=\"https://i.ibb.co/2yvwbPL/Selection-815.png\" alt=\"https://i.ibb.co/2yvwbPL/Selection-815.png\"><br>\n<a href=\"https://d1.awsstatic.com/training-and-certification/docs-ml/AWS-Certified-Machine-Learning-Specialty_Sample-Questions.pdf\" target=\"_blank\">https://d1.awsstatic.com/training-and-certification/docs-ml/AWS-Certified-Machine-Learning-Specialty_Sample-Questions.pdf</a></p>",
      "rawMarkdown": "came across a question relevant to this kaggle competition\n\n![https://i.ibb.co/2yvwbPL/Selection-815.png](https://i.ibb.co/2yvwbPL/Selection-815.png)\nhttps://d1.awsstatic.com/training-and-certification/docs-ml/AWS-Certified-Machine-Learning-Specialty_Sample-Questions.pdf",
      "replies": [
        {
          "id": 2123557,
          "postDate": "2023-01-31T15:25:05.310Z",
          "content": "<p><a href=\"https://ibb.co/FVP7TvF\"><img src=\"https://i.ibb.co/C2r0Gdf/Selection-817.png\" alt=\"Selection-817\"></a></p>\n<p><a href=\"https://ibb.co/3NRdfpK\"><img src=\"https://i.ibb.co/2tZh8vJ/Selection-816.png\" alt=\"Selection-816\"></a></p>\n<p>for me it is different parameters converge to about same stable loss values for for different validation data in this kaggle competition …</p>",
          "rawMarkdown": "<a href=\"https://ibb.co/FVP7TvF\"><img src=\"https://i.ibb.co/C2r0Gdf/Selection-817.png\" alt=\"Selection-817\" border=\"0\"></a>\n\n<a href=\"https://ibb.co/3NRdfpK\"><img src=\"https://i.ibb.co/2tZh8vJ/Selection-816.png\" alt=\"Selection-816\" border=\"0\"></a>\n\n\nfor me it is different parameters converge to about same stable loss values for for different validation data in this kaggle competition ..."
        }
      ]
    },
    {
      "id": 2113225,
      "postDate": "2023-01-24T06:44:13.953Z",
      "content": "<p>it is noted that mean of prediction per breast is better than individual image.<br>\nthis means that mean prediction is a relieable self supervision signal for self supevised image learning.</p>\n<p>in thoery if we apply this to online learning on hidden test data, maybe it can lead to better results?<br>\nof course, there will resources problem</p>",
      "rawMarkdown": "it is noted that mean of prediction per breast is better than individual image.\nthis means that mean prediction is a relieable self supervision signal for self supevised image learning.\n\nin thoery if we apply this to online learning on hidden test data, maybe it can lead to better results?\nof course, there will resources problem"
    },
    {
      "id": 2110198,
      "postDate": "2023-01-22T03:35:14.880Z",
      "content": "<p>i am wondering is there any CNN single fold or (single model) that can hit LB 0.58~0.60?<br>\nI am thinking of discarding CNN model and just use vision transformer in my solution.</p>",
      "rawMarkdown": "i am wondering is there any CNN single fold or (single model) that can hit LB 0.58~0.60?\nI am thinking of discarding CNN model and just use vision transformer in my solution.",
      "replies": [
        {
          "id": 2110541,
          "postDate": "2023-01-22T09:10:18.967Z",
          "content": "<p>CNN Single fold gives me 0.58 in LB</p>",
          "rawMarkdown": "CNN Single fold gives me 0.58 in LB",
          "votes": 7,
          "replies": [
            {
              "id": 2112315,
              "postDate": "2023-01-23T14:42:36.463Z",
              "content": "<p><a href=\"https://www.kaggle.com/arunodhayan\" target=\"_blank\">@arunodhayan</a> amazing! What is your CNN model?</p>",
              "rawMarkdown": "@arunodhayan amazing! What is your CNN model?",
              "votes": 1
            }
          ]
        },
        {
          "id": 2110584,
          "postDate": "2023-01-22T09:32:20.913Z",
          "content": "<p>Single CNN model, 4 folds essemble, LB 0.63</p>",
          "rawMarkdown": "Single CNN model, 4 folds essemble, LB 0.63",
          "votes": 15,
          "replies": [
            {
              "id": 2110595,
              "postDate": "2023-01-22T09:48:38.780Z",
              "content": "<p><a href=\"https://www.kaggle.com/kevin1742064161\" target=\"_blank\">@kevin1742064161</a>  <a href=\"https://www.kaggle.com/arunodhayan\" target=\"_blank\">@arunodhayan</a>  <br>\nThanks</p>\n<p>All are good masterpieces!</p>",
              "rawMarkdown": "@kevin1742064161  @arunodhayan  \nThanks\n\nAll are good masterpieces!",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2107235,
      "postDate": "2023-01-19T16:49:32.827Z",
      "content": "<p>i made a bug and fold that for one fold you can re-run with different seed and ensemble for better  (and more stable?) results</p>",
      "rawMarkdown": "i made a bug and fold that for one fold you can re-run with different seed and ensemble for better  (and more stable?) results"
    },
    {
      "id": 2099444,
      "postDate": "2023-01-14T12:54:09.803Z",
      "content": "<p>Great work, that's fast! What's the local score for LB 0.58, still one fold? With that speed more fold might be tested :)</p>",
      "rawMarkdown": "Great work, that's fast! What's the local score for LB 0.58, still one fold? With that speed more fold might be tested :)",
      "replies": [
        {
          "id": 2099517,
          "postDate": "2023-01-14T13:33:21.603Z",
          "content": "<p>see the comments </p>\n<pre><code>https :// www. kaggle .com / code / hengck23/3hr-tensorrt-nextvit-example/comments\n</code></pre>\n<p>0.58 should be round up of 0.57</p>",
          "rawMarkdown": "see the comments \n```\nhttps :// www. kaggle .com / code / hengck23/3hr-tensorrt-nextvit-example/comments\n```\n\n0.58 should be round up of 0.57",
          "replies": [
            {
              "id": 2099550,
              "postDate": "2023-01-14T13:46:42.263Z",
              "content": "<p><br>\nAlright the score in the notebook and the other a comment for the LB score 👍</p>",
              "rawMarkdown": "~~local 1 fold CV score of .58 and LB .58??? 👀~~\nAlright the score in the notebook and the other a comment for the LB score 👍"
            }
          ]
        }
      ]
    },
    {
      "id": 2094574,
      "postDate": "2023-01-10T20:55:54.840Z",
      "content": "<p>Hi, could you explain to me the binarised concept please?.</p>\n<p>Thank you in advance</p>",
      "rawMarkdown": "Hi, could you explain to me the binarised concept please?.\n\nThank you in advance"
    },
    {
      "id": 2082104,
      "postDate": "2023-01-01T05:33:56.760Z",
      "content": "<p>how to use age information?<br>\ninstead of consider absolute value, consider something like &gt;30 years and &lt;30 years, etc.<br>\nrefer to radioloogist workflow from the web</p>",
      "rawMarkdown": "how to use age information?\ninstead of consider absolute value, consider something like >30 years and <30 years, etc.\nrefer to radioloogist workflow from the web",
      "replies": [
        {
          "id": 2084829,
          "postDate": "2023-01-03T19:18:04.423Z",
          "content": "<p><img src=\"https://i.ibb.co/6FgwVM9/Selection-465.png\" alt=\"https://i.ibb.co/6FgwVM9/Selection-465.png\"></p>\n<p>cancer distribution by age and site.</p>\n<p>i wonder what causes the peak. I think it is probably the screening programs (e.g. people of certain age are encouraged for screening by the government )  or the workflow (e.g. i always see \"if patient is above age xx, then do this, else do that\")</p>",
          "rawMarkdown": "![https://i.ibb.co/6FgwVM9/Selection-465.png](https://i.ibb.co/6FgwVM9/Selection-465.png)\n\ncancer distribution by age and site.\n\ni wonder what causes the peak. I think it is probably the screening programs (e.g. people of certain age are encouraged for screening by the government )  or the workflow (e.g. i always see \"if patient is above age xx, then do this, else do that\")",
          "votes": 2
        }
      ]
    },
    {
      "id": 2082096,
      "postDate": "2023-01-01T05:21:42.590Z",
      "content": "<p>where are the cancer:<br>\n<a href=\"https://www.youtube.com/watch?v=bH11DhzJRmA&amp;t=2773s\" target=\"_blank\">https://www.youtube.com/watch?v=bH11DhzJRmA&amp;t=2773s</a><br>\nBreast Micro-calcifications : All You Need to Know | Mammography | Dr. Terry Minuk</p>\n<p>Breast Imaging: Calcifications [Basic Radiology]<br>\n<a href=\"https://www.youtube.com/watch?v=7d3nY1ZMr9Q\" target=\"_blank\">https://www.youtube.com/watch?v=7d3nY1ZMr9Q</a></p>",
      "rawMarkdown": "where are the cancer:\nhttps://www.youtube.com/watch?v=bH11DhzJRmA&t=2773s\nBreast Micro-calcifications : All You Need to Know | Mammography | Dr. Terry Minuk\n\nBreast Imaging: Calcifications [Basic Radiology]\nhttps://www.youtube.com/watch?v=7d3nY1ZMr9Q\n"
    },
    {
      "id": 2081628,
      "postDate": "2022-12-31T13:01:31.880Z",
      "content": "<p>you basically can learn the relative position encoding for cross attention</p>\n<p><img src=\"https://i.ibb.co/tsQXDCH/Selection-408.png\" alt=\"https://i.ibb.co/tsQXDCH/Selection-408.png\"></p>",
      "rawMarkdown": "you basically can learn the relative position encoding for cross attention\n\n![https://i.ibb.co/tsQXDCH/Selection-408.png](https://i.ibb.co/tsQXDCH/Selection-408.png)",
      "replies": [
        {
          "id": 2081688,
          "postDate": "2022-12-31T14:09:27.103Z",
          "content": "<p>x1 and x2 = L and R or MLO and CC?</p>",
          "rawMarkdown": "x1 and x2 = L and R or MLO and CC?",
          "replies": [
            {
              "id": 2081690,
              "postDate": "2022-12-31T14:11:20.613Z",
              "content": "<p>L and R of same view</p>",
              "rawMarkdown": "L and R of same view"
            }
          ]
        }
      ]
    },
    {
      "id": 2081227,
      "postDate": "2022-12-31T00:59:01.193Z",
      "content": "<p>\"The difficulty of a problem can be indicated by how quickly a human can complete the task.\"</p>\n<p>only 0.5 sec for screening mammogram !!!</p>\n<p>[1] Radiologists can detect the ‘gist’ of breast cancer before any overt signs of cancer appear<br>\n<a href=\"https://www.nature.com/articles/s41598-018-26100-5\" target=\"_blank\">https://www.nature.com/articles/s41598-018-26100-5</a></p>\n<p>\". Our findings suggest that readers can distinguish patients who were diagnosed with cancer, from individuals without breast cancer (normal category), at above-chance levels based on a half-second glimpse of the mammogram even before any lesion becomes visible on the mammogram\"</p>\n<p>human expert here can be interpreted as having experience (i.e. see many data before) or having natural ability to spot some image characteristics (i.e. some good network architecture that model data prior distribution well) </p>",
      "rawMarkdown": "\"The difficulty of a problem can be indicated by how quickly a human can complete the task.\"\n\nonly 0.5 sec for screening mammogram !!!\n\n[1] Radiologists can detect the ‘gist’ of breast cancer before any overt signs of cancer appear\nhttps://www.nature.com/articles/s41598-018-26100-5\n\n\". Our findings suggest that readers can distinguish patients who were diagnosed with cancer, from individuals without breast cancer (normal category), at above-chance levels based on a half-second glimpse of the mammogram even before any lesion becomes visible on the mammogram\"\n\nhuman expert here can be interpreted as having experience (i.e. see many data before) or having natural ability to spot some image characteristics (i.e. some good network architecture that model data prior distribution well) ",
      "replies": [
        {
          "id": 2081229,
          "postDate": "2022-12-31T01:00:53.277Z",
          "content": "<p>on a very far side note, how i use gpt-chat:<br>\n<img src=\"https://i.ibb.co/z7ySzws/Selection-388.png\" alt=\"https://i.ibb.co/z7ySzws/Selection-388.png\"></p>",
          "rawMarkdown": "on a very far side note, how i use gpt-chat:\n![https://i.ibb.co/z7ySzws/Selection-388.png](https://i.ibb.co/z7ySzws/Selection-388.png)",
          "votes": -1
        },
        {
          "id": 2081410,
          "postDate": "2022-12-31T06:31:08.700Z",
          "content": "<p>Interesting metrics - <a href=\"https://pubmed.ncbi.nlm.nih.gov/35434976/\" target=\"_blank\">https://pubmed.ncbi.nlm.nih.gov/35434976/</a></p>\n<blockquote>\n  <p>Results: The AUROC of the AI alone, BSR (average across five readers), and GR (average across five readers) groups was 0.915 (95% confidence interval, 0.876-0.954), 0.813 (0.756-0.870), and 0.684 (0.616-0.752), respectively. With AI assistance, the AUROC significantly increased to 0.884 (0.840-0.928) and 0.833 (0.779-0.887) in the BSR and GR groups, respectively (p = 0.007 and p &lt; 0.001, respectively). Sensitivity was improved by AI assistance in both groups (74.6% vs. 88.6% in BSR, p &lt; 0.001; 52.1% vs. 79.4% in GR, p &lt; 0.001), but the specificity did not differ significantly (66.6% vs. 66.4% in BSR, p = 0.238; 70.8% vs. 70.0% in GR, p = 0.689). The average reading time pooled across readers was significantly decreased by AI assistance for BSRs (82.73 vs. 73.04 seconds, p &lt; 0.001) but increased in GRs (35.44 vs. 42.52 seconds, p &lt; 0.001).</p>\n</blockquote>\n<p>ie: <br>\nAI alone - 0.915 AUROC<br>\nAI + Breast Specialist Radiologist (BSR) - 0.884 AUROC<br>\nAI + General Radiologist (GR) - 0.833 AUROC</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9052057%2F13608b3ddd45bde3f37d7eb3ef3a0533%2Fbsrmetrics.png?generation=1672469521043553&amp;alt=media\" alt=\"\"></p>",
          "rawMarkdown": "Interesting metrics - https://pubmed.ncbi.nlm.nih.gov/35434976/\n\n>Results: The AUROC of the AI alone, BSR (average across five readers), and GR (average across five readers) groups was 0.915 (95% confidence interval, 0.876-0.954), 0.813 (0.756-0.870), and 0.684 (0.616-0.752), respectively. With AI assistance, the AUROC significantly increased to 0.884 (0.840-0.928) and 0.833 (0.779-0.887) in the BSR and GR groups, respectively (p = 0.007 and p < 0.001, respectively). Sensitivity was improved by AI assistance in both groups (74.6% vs. 88.6% in BSR, p < 0.001; 52.1% vs. 79.4% in GR, p < 0.001), but the specificity did not differ significantly (66.6% vs. 66.4% in BSR, p = 0.238; 70.8% vs. 70.0% in GR, p = 0.689). The average reading time pooled across readers was significantly decreased by AI assistance for BSRs (82.73 vs. 73.04 seconds, p < 0.001) but increased in GRs (35.44 vs. 42.52 seconds, p < 0.001).\n\nie: \nAI alone - 0.915 AUROC\nAI + Breast Specialist Radiologist (BSR) - 0.884 AUROC\nAI + General Radiologist (GR) - 0.833 AUROC\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9052057%2F13608b3ddd45bde3f37d7eb3ef3a0533%2Fbsrmetrics.png?generation=1672469521043553&alt=media)",
          "votes": 1
        }
      ]
    },
    {
      "id": 2070378,
      "postDate": "2022-12-19T23:59:27.057Z",
      "content": "<p>there is something interesting about the dicom tag …</p>\n<p><img src=\"https://i.ibb.co/ZLQj0Ck/Selection-231.png\" alt=\"https://i.ibb.co/ZLQj0Ck/Selection-231.png\"><br>\n<img src=\"https://i.ibb.co/ZdDWmnQ/Selection-232.png\" alt=\"https://i.ibb.co/ZdDWmnQ/Selection-232.png\"></p>\n<pre><code>plt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==1], dicom_tag_df.ContentTime[dicom_tag_df.cancer==1],'o' )\nplt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==0], dicom_tag_df.ContentTime[dicom_tag_df.cancer==0],'.' )\n</code></pre>",
      "rawMarkdown": "there is something interesting about the dicom tag ...\n\n![https://i.ibb.co/ZLQj0Ck/Selection-231.png](https://i.ibb.co/ZLQj0Ck/Selection-231.png)\n![https://i.ibb.co/ZdDWmnQ/Selection-232.png](https://i.ibb.co/ZdDWmnQ/Selection-232.png)\n\n\n```\nplt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==1], dicom_tag_df.ContentTime[dicom_tag_df.cancer==1],'o' )\nplt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==0], dicom_tag_df.ContentTime[dicom_tag_df.cancer==0],'.' )\n\n\n```",
      "replies": [
        {
          "id": 2070396,
          "postDate": "2022-12-20T00:50:07.277Z",
          "content": "<p>I am able to recreate the first plot, what does the second plot represent (the one with only 225 values on x axis)?</p>",
          "rawMarkdown": "I am able to recreate the first plot, what does the second plot represent (the one with only 225 values on x axis)?",
          "replies": [
            {
              "id": 2070401,
              "postDate": "2022-12-20T01:06:22.437Z",
              "content": "<p>machine id</p>",
              "rawMarkdown": "machine id",
              "votes": 1
            }
          ]
        },
        {
          "id": 2081191,
          "postDate": "2022-12-30T22:58:02.503Z",
          "content": "<p>What is the meaning of the x-axis in these plots? How did you assign the index in your dataframe?</p>\n<p>The <a href=\"https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html#:~:text=8%20bytes%20fixed-,TM,-Time\" target=\"_blank\">DICOM docs</a> indicate that ContentTime is actually a string in the format HHMMSS, which may explain the pattern in the first plot.</p>",
          "rawMarkdown": "What is the meaning of the x-axis in these plots? How did you assign the index in your dataframe?\n\nThe [DICOM docs](https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html#:~:text=8%20bytes%20fixed-,TM,-Time) indicate that ContentTime is actually a string in the format HHMMSS, which may explain the pattern in the first plot."
        }
      ]
    },
    {
      "id": 2069578,
      "postDate": "2022-12-19T06:20:06.457Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a>  What is different of per image with per patient-laterality?</p>",
      "rawMarkdown": "Hi @hengck23  What is different of per image with per patient-laterality?"
    },
    {
      "id": 2063377,
      "postDate": "2022-12-12T20:26:56.597Z",
      "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> I looked into your code - could you explain line </p>\n<p><code>cancer =  torch.nan_to_num(cancer)</code></p>\n<p>in inference prart? Any issues with nan's and efficientnet?</p>",
      "rawMarkdown": "@hengck23 I looked into your code - could you explain line \n\n```cancer =  torch.nan_to_num(cancer)```\n\nin inference prart? Any issues with nan's and efficientnet?",
      "replies": [
        {
          "id": 2063386,
          "postDate": "2022-12-12T20:56:33.007Z",
          "content": "<p>i haven't checked. but i suspect sigmoid in FP16 (turn last logit to probability).<br>\na better solution is</p>\n<pre><code>cancer = torch.sigmoid(cancer.float())\n</code></pre>",
          "rawMarkdown": "i haven't checked. but i suspect sigmoid in FP16 (turn last logit to probability).\na better solution is\n\n```\ncancer = torch.sigmoid(cancer.float())\n```",
          "votes": 1
        },
        {
          "id": 2065960,
          "postDate": "2022-12-15T08:36:35.603Z",
          "content": "<p>I noticed that if you use amp autocast in inference prart Efficientnet is able to generate NaN in logits. Just leaving only autocast in training loop solve this issue.</p>",
          "rawMarkdown": "I noticed that if you use amp autocast in inference prart Efficientnet is able to generate NaN in logits. Just leaving only autocast in training loop solve this issue.",
          "replies": [
            {
              "id": 2066692,
              "postDate": "2022-12-16T00:37:12.427Z",
              "content": "<p>i need to save memory for inference too if i am using bigger size input like 2048</p>",
              "rawMarkdown": "i need to save memory for inference too if i am using bigger size input like 2048"
            }
          ]
        }
      ]
    },
    {
      "id": 2062488,
      "postDate": "2022-12-12T06:42:25.330Z",
      "content": "<p>did you use pretrained weights?</p>",
      "rawMarkdown": "did you use pretrained weights?"
    },
    {
      "id": 2059564,
      "postDate": "2022-12-09T03:04:17.513Z",
      "content": "<p>Thanks a lot for nice work. <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> <br>\nHow many epochs have you set during training? </p>",
      "rawMarkdown": "Thanks a lot for nice work. @hengck23 \nHow many epochs have you set during training? ",
      "replies": [
        {
          "id": 2059573,
          "postDate": "2022-12-09T03:17:34.377Z",
          "content": "<pre><code>see code at\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n</code></pre>\n<p>type rubbish to prevent error :<br>\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"<br>\njnckjsakdywuienckdjfadkaslfjsdiopmcdsl,fjsklfjposdm,cplsdfm,sdmcvl;sdlifposekrmf,dsfmsdl;fkspkfdl;s,cs;kflsd;kf;dlsrkapkfl;sdfk;sdf</p>",
          "rawMarkdown": "```\n\nsee code at\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n```\n\ntype rubbish to prevent error :\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"\njnckjsakdywuienckdjfadkaslfjsdiopmcdsl,fjsklfjposdm,cplsdfm,sdmcvl;sdlifposekrmf,dsfmsdl;fkspkfdl;s,cs;kflsd;kf;dlsrkapkfl;sdfk;sdf"
        }
      ]
    },
    {
      "id": 2058746,
      "postDate": "2022-12-08T07:12:54.957Z",
      "content": "<p>Hi ! I'd like to ask about the training data. Do you take any method to deal with the imbalance of the dataset? Like using Focal loss or oversampling. Or do you just put the origin data into the training? I am sincerely looking forward to your answer.😀👋</p>",
      "rawMarkdown": "Hi ! I'd like to ask about the training data. Do you take any method to deal with the imbalance of the dataset? Like using Focal loss or oversampling. Or do you just put the origin data into the training? I am sincerely looking forward to your answer.😀👋",
      "replies": [
        {
          "id": 2058778,
          "postDate": "2022-12-08T07:55:18.720Z",
          "content": "<pre><code>see code at\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n</code></pre>\n<p>type rubbish to prevent error :<br>\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"<br>\ndsfdskluremncjkzsysajbndsakljfogkdf;lgm;dfbm,;sdldjflausdsaljflkjglkngldjkglseruioejlsknflmsncvmcnhskluflsdjkfkldsjfsdlkfjlsdkursljf</p>",
          "rawMarkdown": "```\n\nsee code at\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n```\n\ntype rubbish to prevent error :\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"\ndsfdskluremncjkzsysajbndsakljfogkdf;lgm;dfbm,;sdldjflausdsaljflkjglkngldjkglseruioejlsknflmsncvmcnhskluflsdjkfkldsjfsdlkfjlsdkursljf"
        }
      ]
    },
    {
      "id": 2057737,
      "postDate": "2022-12-07T10:13:25.233Z",
      "content": "<p>Interesting topic as usual! Thank you for sharing your experience. <br>\na. Looking into your tables and see numbers - what is your batch size (res -&gt; 1024)? Have you tried to change bs to see results? <br>\nb. Do you use ROI extracted images on resized only?</p>",
      "rawMarkdown": "Interesting topic as usual! Thank you for sharing your experience. \na. Looking into your tables and see numbers - what is your batch size (res -> 1024)? Have you tried to change bs to see results? \nb. Do you use ROI extracted images on resized only?",
      "replies": [
        {
          "id": 2057748,
          "postDate": "2022-12-07T10:17:20.100Z",
          "content": "<p>all are using batch size = 32 (including input 1024).<br>\ni use full image (without ROI extraction)</p>\n<hr>\n<p>Have you tried to change bs to see results?<br>\nnot yet</p>",
          "rawMarkdown": "all are using batch size = 32 (including input 1024).\ni use full image (without ROI extraction)\n\n---\nHave you tried to change bs to see results?\nnot yet",
          "votes": 1
        }
      ]
    },
    {
      "id": 2057219,
      "postDate": "2022-12-06T21:16:35.123Z",
      "content": "<p>Thanks for the post <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a>. What validation are you using? <code>StratifiedGroupKFold</code>?</p>",
      "rawMarkdown": "Thanks for the post @hengck23. What validation are you using? `StratifiedGroupKFold`?",
      "replies": [
        {
          "id": 2057780,
          "postDate": "2022-12-07T10:39:56.207Z",
          "content": "<pre><code>see\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n</code></pre>\n<p>type rubbish to prevent error :<br>\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"<br>\nskjdslakjireutpertmgt,mgsd.,kjsapoiewopqkr;lfds./gmd/gl';vblg][ohkajkashdasdjksahdksahdksajdhsa</p>",
          "rawMarkdown": "```\n\nsee\nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug\n```\n\ntype rubbish to prevent error :\n\"This edit is too similar to a previous post. We prevent redundant comments to reduce spam.\"\nskjdslakjireutpertmgt,mgsd.,kjsapoiewopqkr;lfds./gmd/gl';vblg][ohkajkashdasdjksahdksahdksajdhsa"
        }
      ]
    },
    {
      "id": 2055504,
      "postDate": "2022-12-05T05:59:25.733Z",
      "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> Are the 1024 models trained first at lower resolutions or do you go straight to 1024?</p>",
      "rawMarkdown": "@hengck23 Are the 1024 models trained first at lower resolutions or do you go straight to 1024?",
      "replies": [
        {
          "id": 2055507,
          "postDate": "2022-12-05T06:00:58.243Z",
          "content": "<p>i trained straight from 1024 images</p>",
          "rawMarkdown": "i trained straight from 1024 images\n",
          "votes": 1,
          "replies": [
            {
              "id": 2069847,
              "postDate": "2022-12-19T11:35:13.853Z",
              "content": "<p>Thanks a lot for nice work. How you choose the threshold for maximizing pfbeta when you ensemble models? Do you just take an average of thresholds of the models?</p>",
              "rawMarkdown": "Thanks a lot for nice work. How you choose the threshold for maximizing pfbeta when you ensemble models? Do you just take an average of thresholds of the models?"
            }
          ]
        }
      ]
    },
    {
      "id": 2172483,
      "postDate": "2023-03-07T14:52:38.930Z",
      "content": "<p>Thank you for the post.</p>",
      "rawMarkdown": "Thank you for the post."
    },
    {
      "id": 2058718,
      "postDate": "2022-12-08T06:31:26.887Z",
      "content": "<p>Thank you very much!</p>",
      "rawMarkdown": "Thank you very much!"
    }
  ],
  "comments": [
    {
      "id": 2109056,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-21T05:12:47.273000",
      "content": "<p>example of using rejection-based approach.<br>\nyou can improve accuracy with less computation.</p>\n<pre><code>LB : 0.58\n  test_df0 = test_df.copy()\n  probability0 = do_predict(net0, test_df0)\n  test_df0.loc[:,'cancer_p0']=probability0\n\n\n    #---\n    t = np.percentile(probability0,65) #reject 65%\n    test_df1 = test_df0[test_df0.cancer_p0&gt;t].reset_index(drop=True)\n    probability1 = do_predict(net1, test_df1)\n    test_df1.loc[:,'cancer_p1']=probability1\n\n    # ---\n\n\nLB : 0.59  (cv increase +0.02)\n    df = test_df0.merge(test_df1[['image_id','cancer_p1']],on='image_id',how='left')\n    df.loc[df.cancer_p1.isna(),'cancer_p1'] = df.cancer_p0\n    probability = (df.cancer_p0.values +  df.cancer_p1.values)/2\n\nnet0 and net1 are trained using same fold but different seed\n</code></pre>\n<p><img src=\"https://i.ibb.co/6szKVLc/Selection-613.png\" alt=\"https://i.ibb.co/6szKVLc/Selection-613.png\"></p>\n<hr>\n<p>tip:</p>\n<p>net1 can also be a network that uses higher resolution, etc </p>\n<hr>\n<p>[1]Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time</p>\n<p>use larger learning rate to learn a coarse model.<br>\nthen finetune using different seed (+ different hyperparameters, rate, weighing, etc)</p>\n<p>ensemble all using the method  in [1], i.e. just average the weights of the best k-models in greedy way.</p>",
      "votes": 13,
      "replies": []
    },
    {
      "id": 2096760,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-12T08:43:06.620000",
      "content": "<p>transformer is the king!</p>\n<p><a href=\"https://ibb.co/5FLzVqs\"><img src=\"https://i.ibb.co/sHqDrLs/Selection-516.png\" alt=\"Selection-516\"></a><br>\n<a href=\"https://ibb.co/8rTz5Wm\"><img src=\"https://i.ibb.co/McW8VYg/Selection-515.png\" alt=\"Selection-515\"></a></p>",
      "votes": 13,
      "replies": [
        {
          "id": 2096777,
          "author_name": "Psi",
          "author_url": "",
          "post_date": "2023-01-12T08:56:26.153000",
          "content": "<p>Havent heard about NextVIT thanks for sharing, I do not even find it in timm :)</p>\n<p>BTW I am surprised of your f1 score of 0.5 given that AUC is 0.9. </p>",
          "votes": 0,
          "replies": [
            {
              "id": 2096816,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-12T09:20:57.397000",
              "content": "<p>ROC-AUC is actually also not stable. you can get good F1 and AUC at CV by over sampling positive class and very strong model (e.g. imagenet top-1 0.86). But then i find that it is actually overfitting. </p>\n<p>for AUC of 0.90, F1 can varies a lot</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2096832,
              "author_name": "Psi",
              "author_url": "",
              "post_date": "2023-01-12T09:31:40.157000",
              "content": "<p>I see slight variation but not that big.</p>\n<p>What is ve class?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2096835,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-12T09:32:32.033000",
              "content": "<p>it is positive class</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2097902,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-13T03:44:37.150000",
              "content": "<p></p>\n<p></p>\n<p></p>\n<p>manged to get tensorRT working!</p>\n<p>performance on local PC:</p>\n<pre><code>num of images process 10935\n\npytorch fp16\n-----\ntime = 20 min 26 sec\nauc =  0.8925856621368753\nf1score.max()  =  0.4968558969524153\n@threshold 0.3061224489795918\n\ntensorRT fp16\n-----\ntime =  9 min 05 sec\nauc  = 0.8926157748322697\nf1score.max() = 0.49423766814841186\n@threshold 0.3061224489795918\n</code></pre>\n<p>performance on kaggle notebook to come later …</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2101298,
              "author_name": "nicehzj",
              "author_url": "",
              "post_date": "2023-01-15T19:43:05.330000",
              "content": "<p>If oversampling positive class will cause over fitting, may I ask how did you deal with the unbalance of neg/pos? BCE loss with weight? I read your discussion about multi-view. Your neg/pos is about 7:1. Thanks!</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2108317,
              "author_name": "YujiAriyasu",
              "author_url": "",
              "post_date": "2023-01-20T12:28:38.563000",
              "content": "<blockquote>\n  <p>But then i find that it is actually overfitting</p>\n</blockquote>\n<p>How did you find this out?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2108339,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-20T12:57:08.803000",
              "content": "<p>\"But then i find that it is actually overfitting\"<br>\nHow did you find this out?</p>\n<hr>\n<p>The curve below and the LB results<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/378521\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/378521</a></p>\n<hr>\n<p>let's do a thought experiment</p>\n<ol>\n<li>i train a model for very long iterations …. at the end it definitely overfits due to very long training.<br>\n2.at the begining it underfits.</li>\n<li>in the middle it is optimum. but i don't know where is it.</li>\n<li>you can use verify the optimum using validation set and LB hidden test dataset. But these are not relieable due to sample data size. but nevertheless, they are the \"best guess\"<br>\n5.if i plot the analytic curves for all the iterations,  i try to map observations of the curves to the generalisation of the model.</li>\n</ol>\n<p>you should at least note the following:</p>\n<ol>\n<li>if overfitted, the distuburion are sharp. in the extreme case, you see 2 delta function for pos and neg curve</li>\n<li>if overfitted, site1 and site2 a diverge. i,e,the model overfit part of the data and scrifice other data for better overall score</li>\n</ol>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2108347,
              "author_name": "YujiAriyasu",
              "author_url": "",
              "post_date": "2023-01-20T13:07:35.227000",
              "content": "<p>Oh, I see, I get it, thanks!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2096785,
          "author_name": "Kirderf",
          "author_url": "",
          "post_date": "2023-01-12T09:05:01.823000",
          "content": "<p>CV of .497 👌! Is that cross-validation over how many folds? Thanks for the NextVIT architecture advice 👍</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2096815,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-12T09:17:43.723000",
              "content": "<p>only one fold for CV and LB</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2096837,
              "author_name": "Psi",
              "author_url": "",
              "post_date": "2023-01-12T09:34:03.063000",
              "content": "<p>okay that makes more sense then</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2096866,
              "author_name": "Kirderf",
              "author_url": "",
              "post_date": "2023-01-12T09:56:08.937000",
              "content": "<p>Alright thanks for info. <br>\nFor my training and testing the diff. in scores between folds and the sensitive threshold optimizing in numbers and math, give fear for a large shakeup. <br>\nHope you others have a more stable solutions and scores between the folds than I have ;)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2097060,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-12T12:45:19.033000",
              "content": "<p>one fold nextvit-b at 1536x960 already takes 9hr to run for the submission. <br>\nhence i am unable to run for an ensemble  of multiple folds.</p>\n<p>now i am solving this problem. (e.g. an early rejector, faster voi_lut_apply(), tensorRT or change a faster vision transformer).</p>\n<p>I also try other transformer like CoAT, PVTv2 and the results are generally good in CV (i haven't make submission for these yet)</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2098405,
              "author_name": "Eleftherios Fanioudakis",
              "author_url": "",
              "post_date": "2023-01-13T14:18:21.227000",
              "content": "<p>thanks for the info, how does base compare to the small nextvit? </p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2097098,
          "author_name": "YYama",
          "author_url": "",
          "post_date": "2023-01-12T13:20:04.460000",
          "content": "<p>Thanks again for sharing!</p>\n<p>I am immediately trying out nextvit and I found that it is very difficult to train nextvit.<br>\nWith the same parameters as before, I had early gradient explosions, and when I reduced the learning rate, it converged but performance dropped.</p>\n<p>Do you have any good tips for training?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2097248,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-12T14:37:58.990000",
              "content": "<p>the parameters for training transformer (nextvit and others) are different from cnn<br>\nin general, learning rate and loss (oversampling or margin or +ve weighing) determines results</p>\n<p>i use the following:</p>\n<pre><code>image_height = 1536\nimage_width  = 960\n\npretain = '/home/titanx/hengck/share1/data/pretrain_model/nextvit_base_in1k_384.pth'\nnextvit_base()\nF.binary_cross_entropy_with_logits(cancer,batch['cancer'])\n\n\n    batch_size = 8 \n    ratio = 8 (1  pos sample in every 8 train sample)\n\n\n    def scheduler(epoch): \n\n        num_epoch = 6\n        start_lr  = 5e-5\n        min_lr    = 1e-5\n        lr = (num_epoch-epoch)/num_epoch * (start_lr-min_lr) + min_lr\n        lr = max(min_lr,lr)\n        return lr\n\n\n    optimizer = Lookahead(RAdam(filter(lambda p: p.requires_grad, net.parameters()),lr=-1), alpha=0.5, k=5)\n</code></pre>\n<p>train log (validation is without TTA)</p>\n<pre><code>** start training here! **\n   batch_size = 8,  ratio = 8\n   experiment = ['nextvit-b-1536', 'run_train_fold0.py']\n                           |-------------------------- VALID-------------------|---------------- TRAIN/BATCH --------\nrate     iter        epoch | loss   auc,   f1      th     sen    spec  f1 mean |  loss                | time         \n---------------------------------------------------------------------------------------------------------------------\n0.00e+0   00000000*   0.00 | 0.674  0.491  0.0437  0.490  0.539  0.481  0.043  | 0.000  0.000  0.000  |  0 hr 05 min\n4.33e-5   00006122*   1.00 | 0.194  0.759  0.2096  0.735  0.199  0.984  0.240  | 0.342  0.000  0.000  |  1 hr 27 min\n3.67e-5   00012244*   2.00 | 0.118  0.798  0.2516  0.531  0.249  0.984  0.349  | 0.271  0.000  0.000  |  2 hr 50 min\n3.00e-5   00018366*   3.00 | 0.091  0.815  0.3387  0.592  0.245  0.996  0.433  | 0.230  0.000  0.000  |  4 hr 13 min\n2.33e-5   00024488*   4.00 | 0.099  0.837  0.3718  0.796  0.278  0.995  0.465  | 0.179  0.000  0.000  |  5 hr 35 min\n1.67e-5   00030610*   5.00 | 0.102  0.834  0.3665  0.449  0.369  0.986  0.460  | 0.185  0.000  0.000  |  6 hr 58 min\n1.00e-5   00036732*   6.00 | 0.089  0.817  0.3350  0.122  0.320  0.987  0.452  | 0.166  0.000  0.000  |  8 hr 21 min\n1.00e-5   00042854*   7.00 | 0.094  0.819  0.3711  0.653  0.282  0.995  0.508  | 0.153  0.000  0.000  |  9 hr 44 min\n1.00e-5   00048976*   8.00 | 0.091  0.802  0.3829  0.163  0.307  0.993  0.473  | 0.154  0.000  0.000  | 11 hr 07 min\n</code></pre>\n<p>finally apply TTA and swa for</p>\n<pre><code>def make_swa():\n    out_file = fold_dir + f'/checkpoint/swa.model.pth' \n    iteration = [\n        '00048976',\n        '00042854',\n        '00036732',\n        '00036732',\n        '00030610',\n        '00024488',\n    ]\n    state_dict = None\n    for i in iteration:\n        f = fold_dir + f'/checkpoint/{i}.model.pth'\n        print(f)\n        f = torch.load(f, map_location=lambda storage, loc: storage)\n        if state_dict is None:\n            state_dict = f['state_dict']\n        else:\n            key = list(f['state_dict'].keys())\n            for k in key:\n                state_dict[k] = state_dict[k] + f['state_dict'][k]\n\n    for k in key:\n        state_dict[k] = state_dict[k] / len(iteration)\n    print('')\n\n    print(out_file)\n    torch.save({'state_dict': state_dict}, out_file)\n</code></pre>\n<p>cpu augmentation is too slow. so i use kornia gpu augmentation</p>\n<pre><code>class DataAugmentation1(nn.Module):\n    def __init__(self,):\n        super().__init__()\n        self.flip = nn.Sequential(\n            RandomHorizontalFlip(p=0.5),\n            RandomVerticalFlip(p=0.5),\n        )\n\n        p=0.8\n        self.transform_geometry = ImageSequential(\n            RandomAffine(degrees=20, translate=0.1, scale=[0.8,1.2], shear=20, p=p),\n            RandomThinPlateSpline(scale=0.25, p=p),\n            random_apply=1, #choose 1\n        )\n\n        p=0.5\n        self.transform_intensity = ImageSequential(\n            RandomGamma(gamma=(0.5, 1.5), gain=(0.5, 1.2), p=p),\n            RandomContrast(contrast=(0.8,1.2), p=p),\n            RandomBrightness(brightness=(0.8,1.2), p=p),\n            random_apply=1, #choose 1\n        )\n\n        p=0.5\n        self.transform_other = ImageSequential(\n            MyRoll(p=0.1), #Mosaic Augmentation using only one image, implemented by using pytorch roll , i.e. cyclic shift\n            MyCutOut(num_block=5, block_size=[0.1, 0.2], fill='constant', p=0.1),\n            random_apply=1, #choose 1\n        )\n\n\n    @torch.no_grad()  # disable gradients for effiency\n    def forward(self, x):\n        x = self.flip(x)  # BxCxHxW\n        x = self.transform_geometry(x)\n        x = self.transform_intensity(x)\n        x = self.transform_other(x)\n        return x\n</code></pre>",
              "votes": 13,
              "replies": []
            },
            {
              "id": 2097267,
              "author_name": "YYama",
              "author_url": "",
              "post_date": "2023-01-12T14:47:56.330000",
              "content": "<p>Thank you for being quite detailed!<br>\nIt's quite different from my setting, so I'm learning a lot.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2098082,
              "author_name": "slime",
              "author_url": "",
              "post_date": "2023-01-13T07:53:06.727000",
              "content": "<p>can you tell what is f1 in the log above? is it non-thresholded pF1?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2098098,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-13T08:16:50.987000",
              "content": "<p>max threshold f1</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2144080,
              "author_name": "Neeraj Anand",
              "author_url": "",
              "post_date": "2023-02-14T18:11:39.030000",
              "content": "<p>Can you please explain why lr = -1 in optimizer?</p>",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2097365,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2023-01-12T16:06:36.973000",
          "content": "<p>Does SWA stands for  Stochastic Weight Averaging? <br>\nNice score!</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2097370,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-12T16:08:50.243000",
              "content": "<p>OK. I see …. :) </p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2101305,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2023-01-15T19:53:03.410000",
          "content": "<p>Have you encountered any problem during training - loss NaN (I use oryginal naxtViT repo)? </p>",
          "votes": 0,
          "replies": [
            {
              "id": 2101474,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-16T00:10:33.573000",
              "content": "<p>maybe try use smaller learning rate. 5e-5 to 1e-5.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2101811,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-16T07:09:42.660000",
              "content": "<p>yes, I started from 5e-5 but unfortunately exploded during second epoch. I will try today to do more experiments.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2101847,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-16T08:01:41.480000",
              "content": "<p>increased pos sampling e.g. from 1 pos in batch=8 to 1 in 4.<br>\nuse 3e-5</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2101954,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-16T10:13:13.940000",
              "content": "<p>I followed your suggestion (starting lr 3e-5) and no NaN appeared. Thank you so much.<br>\nOne more question - do you balance loss function using weight? As I can see my model is good after 1-2 epochs and then started to overfit for \"no cancer\". </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2102072,
              "author_name": "nicehzj",
              "author_url": "",
              "post_date": "2023-01-16T11:21:15.810000",
              "content": "<p>Hi! I have the same question about the loss with balanced weight… Also, what's the good metric to decide a good model? AUC or f1? because in my eval, the highest AUC is around 0.975, which is the same proportion of neg/pos… </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2102225,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-16T13:31:04.297000",
              "content": "<p>e.g.<br>\nset rate=5e-5:<br>\ncannot learn validation f1 is 0.05</p>\n<p>set rate=3e-5:<br>\nvalidation f1 is 0.10 for some first iterations, then fall back to previous case of 0.05 in later iterations</p>\n<p>set rate=1e-5:<br>\nsuccess! validation f1 improves as iterations proceeds</p>\n<hr>\n<p>if it doesn't work even if you set rate=1e-6, then the model cannot be train with you current setup.<br>\nyou have to change oversampling, loss (intermediate aux loss, or other loss than BCE) or use a less complex version (e.g. small, tiny version, etc)</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2103973,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-17T13:58:04.913000",
              "content": "<p>My nextvit (small) is fighting …. 😂 AUC_ROC -&gt; 0.86 / probf1 ~0.36 (val)</p>\n<p><img src=\"https://i.ibb.co/QYfPK1c/W-B-Chart-17-01-2023-14-56-18.png\" alt=\"\"></p>\n<p><img src=\"https://i.ibb.co/4d39pWS/prec.png\" alt=\"\"><br>\n<img src=\"https://i.ibb.co/wMgP9NZ/sep.png\" alt=\"\"></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2104670,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-18T00:37:04.637000",
              "content": "<p>any submission results?</p>\n<p>there could be overfitting</p>\n<ol>\n<li>threshold values are high</li>\n<li>predicted pos distribution kinda of too steep</li>\n</ol>\n<p>but maybe LB results cab be good it is hard to judge.<br>\nyou can select a few intermediate model and submit too</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2104689,
              "author_name": "nicehzj",
              "author_url": "",
              "post_date": "2023-01-18T01:00:05.280000",
              "content": "<p>may I ask what is the metric to choose best model in this competition? AUC? pf1? f1?<br>\nBecause sometimes I found AUC is decreasing but the pf1 is increasing.<br>\nThanks for your answer!</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2105173,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-18T10:27:18.270000",
              "content": "<p>Let me do some more experiment and will submit. I will let you know.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2066638,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-15T22:58:11.623000",
      "content": "<p>it turns that i have lower LB than other kagglers using efficientnet.<br>\ni have forgotten to set the drop path rate. Here is the fixed:</p>\n<pre><code>efficientnet_b2(pretrained=True, drop_rate = 0.3, drop_path_rate = 0.2)\n\nrefer to timm efficientnet source code for settings of drop_rate, drop_path_rate\n</code></pre>\n<p>you can use single-fold model (i.e. just one checkpoint file) to get LB &gt;0.51. more on that later,</p>",
      "votes": 14,
      "replies": []
    },
    {
      "id": 2098821,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-13T21:42:00.453000",
      "content": "<p>tensorRT timming is out !!!</p>\n<p>as claimed in the paper, nextVIT is the fastest tensorRT vision transformer (same speed as efficientnet)</p>\n<pre><code>kaggle p100 notebook timing:\n\n--------------------------------------------------\npublic LB submission tensorRT 4 hr : LB 0.56\n\n--------------------------------------------------\nlocal cv 10939 images\n\nauc 0.8936061433377303\nf1score 0.49148140396595846\n@threshold 0.30612\n\n\ntotal (end-to-end from dashboard)\nDisk 16.4/73.1 GB\n1 hr 25 min\n\nbreakdown:\n\n1. install tensorRT, etc 5 min\n\n2. decode 10939 dicom images (keep aspect to 1539, use voi_lut-apply_32fp):\nnvjpeg2k (j2k, 5118 images) 28 min\ndicomsdl (non-j2k, 5917 images, 2 thread) 24 min\n\n3. detect breast box (resnet34 segentation) 2 min\n\n4. tensorRT fp16 nextVIT-B (1539x960)\none fold, original + hflip_TTA\n\nCPU utilisation 120%,  13/13 GB\nGPU utilisation 99% , 4.5/15 GB\n23 min 21 sec (7.80799 images per sec)\n\n\n=============================================\nreference (without tensorRT):\n\nsubmission  9hr : LB 0.56\n\n4. merged_bn fp16 (1539x960)\nCPU utilisation 108%,  13/13 GB\nGPU utilisation 100% , 8.5/15 GB\n95 min 32 sec (1.90819 images per sec)\n</code></pre>",
      "votes": 12,
      "replies": [
        {
          "id": 2098826,
          "author_name": "Psi",
          "author_url": "",
          "post_date": "2023-01-13T21:54:17.697000",
          "content": "<p>How are you loading all images in 4 hours lol :)</p>\n<p>Thanks for sharing - transformer based architectures usually benefit the most from such compiles.</p>\n<p>I am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.</p>",
          "votes": 2,
          "replies": [
            {
              "id": 2098829,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-13T21:57:31.520000",
              "content": "<p>voi_lut_apply_32fp() eats my time. <br>\nwithout it loading images is 3hr.</p>\n<p>maybe i can improve a little by apply resize  first and then the voi lut porcessing on smaller resized image.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2098965,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-14T01:42:01.293000",
              "content": "<p>\"I am curious if anyone got Pytorch 2.0 running in kaggle kernels and have checked how close it comes to tensorrt.\"<br>\ni would think tensorRT is better</p>\n<p><img src=\"https://i.ibb.co/HhXp1j3/Selection-519.png\" alt=\"https://i.ibb.co/HhXp1j3/Selection-519.png\"><br>\n<a href=\"https://medium.com/mlearning-ai/how-does-pytorch-2-0-perform-in-inference-a-benchmark-with-tensorrt-and-onnx-runtime-fa1e59237f93\" target=\"_blank\">https://medium.com/mlearning-ai/how-does-pytorch-2-0-perform-in-inference-a-benchmark-with-tensorrt-and-onnx-runtime-fa1e59237f93</a></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2099207,
              "author_name": "Psi",
              "author_url": "",
              "post_date": "2023-01-14T08:56:41.320000",
              "content": "<p>Yes I also saw this, but reality and graphs are sometimes different. SO Im just curious if someone tried.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2098955,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-01-14T01:25:21.517000",
          "content": "<p>tensorRT engine trt file generation code is here:<br>\n<a href=\"https://www.kaggle.com/code/hengck23/4hr-tensorrt-nextvit-example\" target=\"_blank\">https://www.kaggle.com/code/hengck23/4hr-tensorrt-nextvit-example</a></p>\n<p>i think if you edit the code for 2x T4 GPU, you will get the same LB results in  1.5hr<br>\ntime to try a bigger 2048 image on transformer …</p>",
          "votes": 2,
          "replies": [
            {
              "id": 2099506,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-14T13:30:20.180000",
              "content": "<p>2048x1280 for tensorrt NextVIT-S (smaller variant, imagenet 83.6) takes 5h.</p>\n<p>however, results were as good?<br>\nlocalCV 0.4856957958 <a href=\"https://www.kaggle.com/th\" target=\"_blank\">@th</a>=0.387755102<br>\nLB 0.46</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2100620,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-15T09:57:07.940000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2100625,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-15T10:01:23.500000",
              "content": "<p>set dropout to 0. instead of 0<br>\none is float, the other is int</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100630,
              "author_name": "Guoliang",
              "author_url": "",
              "post_date": "2023-01-15T10:07:28.927000",
              "content": "<p>Many thanks! I'll try it.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100673,
              "author_name": "Guoliang",
              "author_url": "",
              "post_date": "2023-01-15T10:52:17.483000",
              "content": "<p>the error still exist after setting dropout to 0.  instead of 0</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100676,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-15T10:54:21.403000",
              "content": "<p>can you post the full error message</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100684,
              "author_name": "Guoliang",
              "author_url": "",
              "post_date": "2023-01-15T11:00:51.820000",
              "content": "<h2>this is full error message.</h2>\n<p>RuntimeError                              Traceback (most recent call last)<br>\n/tmp/ipykernel_23/1028975912.py in <br>\n     25         enabled_precisions={torch.half},  # Run with FP16<br>\n     26         workspace_size=1 &lt;&lt; 32,\n---&gt; 27         require_full_compilation=True,<br>\n     28     ) <br>\n     29     torch.jit.save(trt_model_fp16, 'kaggle-nextvit-b-1536-gpu-aug0-01-swa.trt_fp16.ts')</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch_tensorrt/_compile.py in compile(module, ir, inputs, enabled_precisions, **kwargs)<br>\n    122                 \"Module was provided as a torch.nn.Module, trying to script the module with torch.jit.script. In the event of a failure please preconvert your module to TorchScript\",<br>\n    123             )<br>\n--&gt; 124             ts_mod = torch.jit.script(module)<br>\n    125         return torch_tensorrt.ts.compile(<br>\n    126             ts_mod, inputs=inputs, enabled_precisions=enabled_precisions, **kwargs</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in script(obj, optimize, _frames_up, _rcb, example_inputs)<br>\n   1285         obj = call_prepare_scriptable_func(obj)<br>\n   1286         return torch.jit._recursive.create_script_module(<br>\n-&gt; 1287             obj, torch.jit._recursive.infer_methods_to_compile<br>\n   1288         )<br>\n   1289 </p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module(nn_module, stubs_fn, share_types, is_tracing)<br>\n    456     if not is_tracing:<br>\n    457         AttributeTypeIsSupportedChecker().check(nn_module)<br>\n--&gt; 458     return create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    459 <br>\n    460 def create_script_module_impl(nn_module, concrete_type, stubs_fn):</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    518 <br>\n    519     # Actually create the ScriptModule, initializing it with the function we just defined<br>\n--&gt; 520     script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)<br>\n    521 <br>\n    522     # Compile methods if necessary</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_script.py in _construct(cpp_module, init_fn)<br>\n    613             \"\"\"<br>\n    614             script_module = RecursiveScriptModule(cpp_module)<br>\n--&gt; 615             init_fn(script_module)<br>\n    616 <br>\n    617             # Finalize the ScriptModule: replace the nn.Module state with our</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in init_fn(script_module)<br>\n    496             else:<br>\n    497                 # always reuse the provided stubs_fn to infer the methods to compile<br>\n--&gt; 498                 scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)<br>\n    499 <br>\n    500             cpp_module.setattr(name, scripted)</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_script_module_impl(nn_module, concrete_type, stubs_fn)<br>\n    522     # Compile methods if necessary<br>\n    523     if concrete_type not in concrete_type_store.methods_compiled:<br>\n--&gt; 524         create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)<br>\n    525         # Create hooks after methods to ensure no name collisions between hooks and methods.<br>\n    526         # If done before, hooks can overshadow methods that aren't exported.</p>\n<p>/opt/conda/lib/python3.7/site-packages/torch/jit/_recursive.py in create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)<br>\n    373     property_rcbs = [p.resolution_callback for p in property_stubs]<br>\n    374 <br>\n--&gt; 375     concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)<br>\n    376 <br>\n    377 def create_hooks_from_stubs(concrete_type, hook_stubs, pre_hook_stubs):</p>\n<p>RuntimeError: Can't redefine method: forward on class: <strong>torch</strong>.torch.nn.modules.dropout.Dropout (of Python compilation unit at: 0x5643bd433f20)</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100711,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-15T11:30:55.010000",
              "content": "<p>this error don't occurs at my side. i also try  torch.jit.trace(model, x) which return successful results.<br>\ncheck that you are using eval()<br>\ni suggest the either of the followings:</p>\n<ol>\n<li><p>there are several versions of nextvit.py file from the github. i am using the image classification one.</p></li>\n<li><p>follow the instruction from the github (export_tensorrt_engine.py), try to create onnx file. This checks your system(version, etc), torch.onnx also calls torch jit script.</p></li>\n<li><p>simply edit your code. replace nn.Dropout with nn.Identity. If there is problem with dropPath create  afunction/class that just let input pass through. (dropout and droppath are not used in eval() mode) </p></li>\n</ol>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100727,
              "author_name": "Guoliang",
              "author_url": "",
              "post_date": "2023-01-15T11:48:57.480000",
              "content": "<p>Thanks for your oppions.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2100931,
              "author_name": "Guoliang",
              "author_url": "",
              "post_date": "2023-01-15T13:56:41.310000",
              "content": "<p>could you share a notebook for generating trt engine file of NextVitNet?</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2100622,
          "author_name": "Guoliang",
          "author_url": "",
          "post_date": "2023-01-15T10:01:06.630000",
          "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8719748%2F3ceef46ac120c13cfdc04a3da3d8d84c%2F111.jpg?generation=1673776841164994&amp;alt=media\" alt=\"\"><br>\nhi, I got above error when generating trt engine file. Could you tell me how to solve it?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2104739,
          "author_name": "outwrest",
          "author_url": "",
          "post_date": "2023-01-18T02:18:19.333000",
          "content": "<p>T4x2 is King, I just switched my pipeline to it, and preprocessing is x1.24 faster. Preprocessing the training set I improve from 3h 26m to 2h 46m !! </p>\n<p>processing the first 5118 j2k and 5917 non-j2k (to compare to your numbers), the pipeline does 9.2 minutes, and 20 minutes respectively! (time also includes yolov5 inference on 640px imgs)</p>\n<p>I get this small speedup by doing all the resizing and windowing operations in different threads on EACH GPU!</p>\n<p>just a note: the apply_voi_lut == apply_windowing since I believe that none of the images in the training set have a VOI lookup table. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2107692,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-20T01:01:26.237000",
      "content": "<p>there is a novel method to fight rare (imbalance) class<br>\n[1] Background Splitting: Finding Rare Classes in a Sea of Background<br>\n<a href=\"https://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf\" target=\"_blank\">https://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf</a></p>\n<p>the idea i simple randomly assign label to your background images. hence even if you sample a batch of all negative images, you will not learn to predict same class<br>\n<a href=\"https://www.youtube.com/watch?v=I6-8mrp99sI\" target=\"_blank\">https://www.youtube.com/watch?v=I6-8mrp99sI</a></p>\n<p><img src=\"https://i.ibb.co/PQST7mG/Selection-594.png\" alt=\"https://i.ibb.co/PQST7mG/Selection-594.png\"></p>",
      "votes": 9,
      "replies": [
        {
          "id": 2108680,
          "author_name": "Sohier Dane",
          "author_url": "",
          "post_date": "2023-01-20T18:16:23.110000",
          "content": "<p>That's a cool idea. I'll be very curious to hear how well it works.</p>",
          "votes": 4,
          "replies": []
        }
      ]
    },
    {
      "id": 2076917,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-27T02:37:49.950000",
      "content": "<p>i find the treasure !!!!</p>\n<p><img src=\"https://i.ibb.co/6tGVML0/Selection-315.png\" alt=\"https://i.ibb.co/6tGVML0/Selection-315.png\"></p>",
      "votes": 10,
      "replies": [
        {
          "id": 2076959,
          "author_name": "ynhuhu",
          "author_url": "",
          "post_date": "2022-12-27T03:51:12.873000",
          "content": "<p>A amazing AUC.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2076990,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2022-12-27T05:26:18.747000",
              "content": "<p><a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/</a></p>",
              "votes": 5,
              "replies": []
            },
            {
              "id": 2076997,
              "author_name": "ynhuhu",
              "author_url": "",
              "post_date": "2022-12-27T05:39:50.727000",
              "content": "<p>Thanks you. </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2076999,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2022-12-27T05:45:35.963000",
              "content": "<p>more baseline models and results later …</p>\n<p>MVCCL model for ADMANI dataset<br>\n<a href=\"https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset\" target=\"_blank\">https://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset</a></p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2077031,
              "author_name": "@kaggleqrdl",
              "author_url": "",
              "post_date": "2022-12-27T06:41:00",
              "content": "<p>\"Our experiments were performed on Swinburne supercomputer OzSTAR* with a cluster of NVIDIA Tesla P100 GPUs\" .. OzSTAR comprises over 5,000 processing cores, 230 GPUs, a collective 25 Terabytes of system memory and access to over 6 Petabytes of storage.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2077034,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2022-12-27T06:46:26.990000",
              "content": "<p>this is because they have 3 million images<br>\nthey resolution is about 2600</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2077038,
              "author_name": "@kaggleqrdl",
              "author_url": "",
              "post_date": "2022-12-27T06:52:07.653000",
              "content": "<blockquote>\n  <p>this is because they have 3 million images<br>\n  they resolution is about 2600</p>\n</blockquote>\n<p>I am referring to the link <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/\" target=\"_blank\">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8456839/</a> </p>\n<p>This is the paper that the above screen cap came from.  Thanks Remek for the cite.</p>\n<p>I don't see any reference to 'millions' of images in the study.  Perhaps I missed it though.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2077041,
              "author_name": "@kaggleqrdl",
              "author_url": "",
              "post_date": "2022-12-27T06:57:08.987000",
              "content": "<p><a href=\"https://www.kaggle.com/ynhuhu\" target=\"_blank\">@ynhuhu</a> Another thing to consider is that the AUC you see above is on the patches.  Here are the top line results from the paper:</p>\n<blockquote>\n  <p>Results<br>\n  Our evaluation uses the area under curve (AUC) and accuracy (ACC) for performance measurement. The best evaluation result, based on 349 test cases (930 test images), was an AUC of 0.8979 [95% confidence interval (CI) 0.873, 0.923] and ACC of 0.8178 [95% CI 0.785, 0.850]. </p>\n</blockquote>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2077053,
              "author_name": "ynhuhu",
              "author_url": "",
              "post_date": "2022-12-27T07:09:24.097000",
              "content": "<p>Ye, you are right. </p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2069441,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-19T01:53:45.930000",
      "content": "<p><img src=\"https://i.ibb.co/jGmX2RS/Selection-228.png\" alt=\"https://i.ibb.co/jGmX2RS/Selection-228.png\"></p>\n<p>in some of the video and websites i have read, we screen  mammography images by comparing left and right images side-by-side (see image above). Instead of predicting based on single image, we use stitch of of R-L image as single input. Alternatively, we can have 2 view (2x single input) and fused them later.</p>\n<p>The advantage is that we both have same breast density, so abnormality can stand out better</p>",
      "votes": 9,
      "replies": [
        {
          "id": 2069467,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-19T02:32:32.970000",
          "content": "",
          "votes": -10,
          "replies": []
        }
      ]
    },
    {
      "id": 2061348,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-11T03:12:28.180000",
      "content": "<p>i see some (very) good improvement in using 16-bit png (instead of 8bit).<br>\nThis is because i am not applying windowing or VOI LUT in the dim data, which itself is tricky.</p>\n<p>It is difficult to large scale experiment (especially for kaggle submission)<br>\nOther kagglers may want to verify this.</p>\n<pre><code>def read_dicom_as_image(dcm_file):\n    dicom = pydicom.dcmread(dcm_file)\n    image = dicom.pixel_array  \n    image = (image - image.min()) / (image.max() - image.min()+1e-6)  #this cast to float32\n    if dicom.PhotometricInterpretation == 'MONOCHROME1':\n        image = 1 - image\n\n    return image\n\ndef parallel_process(dcm_file):\n    patient_id = dcm_file.split('/')[-2]\n    image_id   = dcm_file.split('/')[-1][:-4]\n    image = read_dicom_as_image(dcm_file)\n    image = cv2.resize(image, (image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    image = (image * 65535).astype(np.uint16)\n\n    os.makedirs(f'{png_dir}/{patient_id}', exist_ok=True)\n    cv2.imwrite(f'{png_dir}/{patient_id}/{image_id}.png',image)\n\n\nif 1:\n    Parallel(n_jobs=10)(\n        delayed(parallel_process)(f)\n        for f in tqdm(dcm_file)\n    )\n</code></pre>\n<p>i suspect my previous improvement of 2048 is actually from the intensity improvement</p>\n<hr>\n<p>learnable windowing<br>\nPractical Window Setting Optimization for Medical Image Deep Learning<br>\n<a href=\"https://github.com/MGH-LMIC/windows_optimization\" target=\"_blank\">https://github.com/MGH-LMIC/windows_optimization</a></p>\n<p>CT Window Trainable Neural Network for Improving Intracranial Hemorrhage Detection<br>\n<a href=\"https://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg\" target=\"_blank\">https://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg</a></p>",
      "votes": 10,
      "replies": [
        {
          "id": 2062154,
          "author_name": "Awsaf",
          "author_url": "",
          "post_date": "2022-12-11T19:29:27.940000",
          "content": "<p>I'm not sure how you saved <strong>2048 x 2048</strong> <code>uint16</code> images. Cuz, only <code>13k</code> images take <code>&gt;20GB</code> space, so for total data, it would be nearly <code>&gt;100GB</code> space. In that case, kaggle should throw error. Could you please share how you saved <code>uint16</code> images?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2062195,
          "author_name": "@kaggleqrdl",
          "author_url": "",
          "post_date": "2022-12-11T20:41:29.267000",
          "content": "<p>You could do it off kaggle, right.  Also, batching on kaggle for inference.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2062268,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-11T23:11:24.313000",
          "content": "<p>i do not save at kaggle inference.<br>\ni haven't tried uint16 for 2048 yet. i am running experiments for 1024 for now</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2063994,
          "author_name": "Simon Alerdic",
          "author_url": "",
          "post_date": "2022-12-13T13:01:58.047000",
          "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> Why it's for?</p>\n<pre><code>image = (image * 65535).astype(np.uint16)\n</code></pre>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2064160,
          "author_name": "Ertuğrul Demir",
          "author_url": "",
          "post_date": "2022-12-13T14:58:37.117000",
          "content": "<p>Seems like image is normalized normalized beforehand (usually between 0-1), to cast uint16 you better to multiply these values by 65535 (which is the max value of uint16) before mapping them to rounded uint16 values.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2064198,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-13T15:15:34.003000",
          "content": "<p>this is to save as 16-bit png.<br>\nif you don't save image for inference, the casting is not required</p>\n<p><img src=\"https://i.ibb.co/JdV5v8Y/Selection-174.png\" alt=\"https://i.ibb.co/JdV5v8Y/Selection-174.png\"></p>",
          "votes": 8,
          "replies": [
            {
              "id": 2079543,
              "author_name": "Gunes Evitan",
              "author_url": "",
              "post_date": "2022-12-29T12:09:59.593000",
              "content": "<p>What do you think about normalizing with 16-bit dataset mean/std? <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2094504,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-10T19:37:10.733000",
              "content": "<p>only experiment will confirms results.<br>\nand you don't have to stick to one processing. you can use different processing in ensemble</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2094071,
          "author_name": "Fernando Cossio",
          "author_url": "",
          "post_date": "2023-01-10T15:48:04.460000",
          "content": "<p>This is interesting. If you don't convert to 8bit, you have more information available. But do you still start from the pretrained models on 8 bit images?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2094506,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-10T19:38:04.793000",
              "content": "<p>no.</p>\n<p>it is like if pretrain model is train on 224x224 image size, you can finetune it for larger and smaller size</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2067573,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-16T20:53:11.017000",
      "content": "<p>the fastest you can go is slightly less than 3hr<br>\ninput1024, one model single-fold efficientnetb4</p>\n<p><img src=\"https://i.ibb.co/x5DN900/Selection-206.png\" alt=\"https://i.ibb.co/x5DN900/Selection-206.png\"></p>\n<pre><code>#share ----\ndef normalised_to_8bit(image, photometric_interpretation):\n    xmin = image.min()\n    xmax = image.max() \n    norm = np.empty_like(image, dtype=np.uint8)\n    dicomsdl.util.convert_to_uint8(image, norm, xmin, xmax)\n    if photometric_interpretation == 'MONOCHROME1':\n        norm = 255 - norm\n    return norm\n\n\n# j2k ----\nj2k_decoder = nvjpeg2k.Decoder()\ndef process_j2k(df, dcm_dir, image_dir, image_size):\n    for t, d in tqdm(df.iterrows()):\n        dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n        ds = pydicom.dcmread(dcm_file)\n        offset = ds.PixelData.find(b'\\x00\\x00\\x00\\x0C')\n        jpeg_stream = bytearray(ds.PixelData[offset:]) \n        m = j2k_decoder.decode(jpeg_stream) \n\n\n        # resize and save as png\n        m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n        m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n        cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\n...\n\n#non j2k ----\n\ndef dicomsdl_parallel_process_fn(d, dcm_dir, image_dir, image_size):\n    dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n    ds = dicomsdl.open(dcm_file)\n    info = ds.getPixelDataInfo() \n    m = np.empty(shape=[info['Rows'], info['Cols']], dtype=info['dtype'])\n    ds.copyFrameData(0, m) \n\n    # resize and save as png\n    m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n    m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\ndef process_non_j2k(df, dcm_dir, image_dir, image_size, n_jobs):  \n    Parallel(n_jobs=n_jobs)(\n        delayed(dicomsdl_parallel_process_fn)(d, dcm_dir, image_dir, image_size)\n        for t,d in tqdm(df.iterrows())\n    )\n</code></pre>\n<p>you probably need to retrain with images generated by dicomsdl.util.convert_to_uint8()</p>",
      "votes": 8,
      "replies": [
        {
          "id": 2082166,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-01T07:37:53.707000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2067719,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-17T04:28:46.743000",
      "content": "<p>in theory, you can stitch four 1024 images (LCC,RCC,LMLO,RMLO) into a single 2048 image. Then input this into a single network and make 2 predictions for L,R</p>",
      "votes": 7,
      "replies": [
        {
          "id": 2079570,
          "author_name": "Gunes Evitan",
          "author_url": "",
          "post_date": "2022-12-29T12:34:48.603000",
          "content": "<p>Multiple-instance learning could be useful.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2059408,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-08T20:15:54.477000",
      "content": "<p>[paper] Deep Neural Networks Improve Radiologists’ Performance in Breast Cancer Screening- Nan Wu<br>\n<a href=\"https://github.com/nyukat/breast_cancer_classifier\" target=\"_blank\">https://github.com/nyukat/breast_cancer_classifier</a></p>\n<p>extensive experiments for multi-view prediction (over 1 million images)</p>\n<p><a href=\"https://ibb.co/QQpjs9P\"><img src=\"https://i.ibb.co/sRbJLjK/Selection-142.png\" alt=\"Selection-142\"></a><br>\n<a href=\"https://ibb.co/bJNN6YT\"><img src=\"https://i.ibb.co/M6PPgKr/Selection-141.png\" alt=\"Selection-141\"></a></p>",
      "votes": 7,
      "replies": [
        {
          "id": 2059420,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-08T20:27:19.103000",
          "content": "<p>Very nice concept. Good inspiration! 👍</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2120459,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-29T16:00:55.473000",
      "content": "<p>i tried many multiple images prediction method and below is the only one that works.<br>\nFor nextvit-B local CV improves from 0.49 (single-image predict + mean) to 0.511 (multi-image predict) for the my first experiments:</p>\n<ol>\n<li>i used frozen nextvit-B image encoder (in future i would use finetune)</li>\n<li>i use only channel feature after global pool from image encoder (in future I can use local feature, i.e. feature at each x,y location)</li>\n<li>i did not use augmentation in multi-images training yet</li>\n</ol>\n<p>I got improvement at the first run without adjusting of hyper parameters and pipeline! </p>\n<hr>\n<p>here are more information:<br>\nPART ONE: paper review and description of method</p>\n<p><img src=\"https://i.ibb.co/yy8bBGd/Selection-724.png\" alt=\"https://i.ibb.co/yy8bBGd/Selection-724.png\"></p>\n<p>[1] COVID-19 Prognosis via Self-Supervised Representation Learning and Multi-Image Prediction - A. Sriram (facebook AI),  arXiv 2020<br>\n<a href=\"https://github.com/facebookresearch/CovidPrognosis\" target=\"_blank\">https://github.com/facebookresearch/CovidPrognosis</a></p>\n<p>PART TWO: modification for kaggle breast mammography and example notebook<br>\ndummy code is up: <a href=\"https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction\" target=\"_blank\">https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction</a></p>\n<p>PART THREE: results and analysis<br>\nto be updated</p>",
      "votes": 5,
      "replies": [
        {
          "id": 2120521,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-01-29T16:50:56.257000",
          "content": "<p>first experiment results</p>\n<pre><code>MIP prediction\n\nget_f1score(cancer_p[site_id==1], cancer_t[site_id==1], mode='max')\nOut[10]: (0.4852269914108315, 0.4081632653061224) # (f1score, threshold)\n\nget_f1score(cancer_p[site_id==2], cancer_t[site_id==2], mode='max')\nOut[11]: (0.5681399603886713, 0.24489795918367346)\n\nget_f1score(cancer_p, cancer_t, mode='max')\nOut[12]: (0.5106197826424658, 0.2857142857142857)\nauc = 0.8344857204208718\nbce loss =  0.081253260\n</code></pre>",
          "votes": 1,
          "replies": [
            {
              "id": 2120913,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-29T22:45:47.763000",
              "content": "<p><img src=\"https://i.ibb.co/yQ9KQdz/Selection-728.png\" alt=\"https://i.ibb.co/yQ9KQdz/Selection-728.png\"></p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2121485,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-30T10:53:34.930000",
              "content": "<p>MIP trained with frozen image encoder + augmentation<br>\nuse age, site id, view<br>\n<img src=\"https://i.ibb.co/wWtMJsQ/Selection-739.png\" alt=\"https://i.ibb.co/wWtMJsQ/Selection-739.png\"></p>\n<p><br>\nunfrozen image encoder (last layer only) + augmentation :  worse (overfitting observed)</p>\n<p>unfrozen image encoder (last layer only) + no augmentation :  not that bad??? … to repeat experiment again</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2123664,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-31T16:19:21.270000",
              "content": "<p>Looks really good! Any sub to LB?<br>\nIt appeared that my bug in code had no influence on score. Still one model only 0.57. Looking for new ways to cross over 0.6 😂</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2123956,
              "author_name": "Mad_Neil",
              "author_url": "",
              "post_date": "2023-01-31T18:58:40.430000",
              "content": "<p>Hello <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> Could you tell me which image size did you use to get 0.57 LB? Thanks</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2123989,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-31T19:24:57.640000",
              "content": "<p>From beggining of the competiton I use rule (SIZE, SIZE // 2). Size depends on network architecture I use. Now is (4 * 384, 2 * 384). </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2138174,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-02-10T16:06:57.800000",
              "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> did you ever submit this model to LB?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2145791,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-02-15T11:12:01.113000",
              "content": "<p>yes i did. surprsingly ….  +0.03 in CV, -0.01 in LB </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2146126,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-02-15T16:16:50.693000",
              "content": "<p>I had LB … CV correlation. The worse score in CV the best on LB. This is certainly joke but I am really afraid how to chose final submission. I know that my submissions are shaky… and do not count on anything. </p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2146231,
              "author_name": "NguyenThanhNhan",
              "author_url": "",
              "post_date": "2023-02-15T17:55:37.040000",
              "content": "<p>Our first 2 folds tracked public LB very closely so occassionally I would submit 2 folds' predictions to pump our public position 😂. Also, multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds, which ended up in worse LB scores</p>",
              "votes": 5,
              "replies": []
            },
            {
              "id": 2146426,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-02-15T21:21:39.920000",
              "content": "<p>\"multi-image models boosted local validation pF1 at the cost of much higher optimal thresholds\"</p>\n<p>higher threshold is over fitting i i i think <br>\nit seems that there is not enough data to do multiview prediction, it is quite a pity.</p>\n<p>i have to remove transformer and adopted simpler fusion like mean,max, attention pool, etc …</p>\n<p>also i do not have proper augmentation for multi-view (the views are related, so are the augmentation)</p>\n<hr>\n<p>on a site note, if i perform multi-view  learning on external vindr-mammo dataset with patch prediction (i.e. convert segmentation pixel label to patch label), the class activation maps do show better results on validation set.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2146870,
              "author_name": "NguyenThanhNhan",
              "author_url": "",
              "post_date": "2023-02-16T08:12:27.790000",
              "content": "<p>When I tried your multi-image transformer, I had to freeze 70-80% of backbone blocks and used a very small lr to make it trainable. I also applied the same augmentation to all images per side, like this (albumentations is quite convenient)</p>\n<pre><code>transformed = augment(images=image0, images1=image1 ...)\n</code></pre>\n<p>I agree that we simply don't have enough data for multi-view training 😅. Simpler fusion models like boosted trees, mean, max might work better.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2108173,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-20T10:10:07.493000",
      "content": "<p>this is a cheap way to improve resolution and works for me at local CV</p>\n<p><img src=\"https://i.ibb.co/nsPnr58/Selection-602.png\" alt=\"https://i.ibb.co/nsPnr58/Selection-602.png\"></p>",
      "votes": 5,
      "replies": [
        {
          "id": 2108177,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2023-01-20T10:19:32.057000",
          "content": "<p>Nice. As far as I understand gradient is updated from main loss?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2108234,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-20T11:09:38.887000",
              "content": "<p>gradient is updated from main loss?</p>\n<p>no. all loss</p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2108239,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-20T11:13:30.470000",
              "content": "<p>Thank you for explanation. </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2108280,
              "author_name": "Eleftherios Fanioudakis",
              "author_url": "",
              "post_date": "2023-01-20T11:52:28.547000",
              "content": "<p>did you try different weighting for these losses ?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2108977,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-21T02:16:06.237000",
              "content": "<p>I think this is a mix of two good ideas for aux loss + keeping hi-rez features. I tried something similar using resnet but it didn't improve my local CV.</p>\n<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> this reminds me of the paper (<a href=\"https://arxiv.org/pdf/1409.4842.pdf\" target=\"_blank\">Going deeper with convolutions</a>) from a while back, I recommend checking it out! It is also the first paper that I saw that references a meme 😄😄</p>\n<p><a href=\"https://www.kaggle.com/left13\" target=\"_blank\">@left13</a> aux loss weighting might be interesting to try out, they also do it in the paper I linked above<br>\n\"During training, their loss gets added to the total loss of the network with a discount weight (the losses of the auxiliary classifiers were weighted by 0.3). At inference time, these auxiliary networks are discarded.\" [Going deeper with convolutions, 6]</p>\n<p>I think if we were training from scratch it'll be a small boost to training time but I am interested in how each part affects CV for this competition since we are only fine-tuning the model</p>",
              "votes": 2,
              "replies": []
            }
          ]
        },
        {
          "id": 2110137,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-01-22T02:08:28.810000",
          "content": "<p>if you want to use tensorrt for this model, please note the pytorch resize bug<br>\n<a href=\"https://github.com/pytorch/TensorRT/pull/1561\" target=\"_blank\">https://github.com/pytorch/TensorRT/pull/1561</a><br>\nyou will have to modify the tensorrt py file</p>\n<p>alternatively, just convert the encoder to trt engine and use pytorch nn module for the rest</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2077872,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-27T23:34:30.137000",
      "content": "<p>finally, one paper that compares oversampling, undersampling and weighted class<br>\n<a href=\"https://ibb.co/PFvQqzb\"><img src=\"https://i.ibb.co/8NLc14R/Selection-322.png\" alt=\"Selection-322\"></a><br>\n<a href=\"https://ibb.co/HVLnx1g\"><img src=\"https://i.ibb.co/g3bzPHg/Selection-321.png\" alt=\"Selection-321\"></a></p>\n<p>[1] Comparing Techniques for Class Imbalance in Deep LearningComparing Techniques for Class Imbalance in Deep Learning<br>\nClassification of Breast CancerClassification of Breast Cancer</p>\n<p>the only conclusion is that no conclusion can be made</p>",
      "votes": 5,
      "replies": [
        {
          "id": 2078070,
          "author_name": "@kaggleqrdl",
          "author_url": "",
          "post_date": "2022-12-28T04:27:24.450000",
          "content": "<p><a href=\"https://www.techrxiv.org/articles/preprint/Comparing_Techniques_for_Class_Imbalance_in_Deep_Learning_Classification_of_Breast_Cancer/21400632\" target=\"_blank\">https://www.techrxiv.org/articles/preprint/Comparing_Techniques_for_Class_Imbalance_in_Deep_Learning_Classification_of_Breast_Cancer/21400632</a></p>\n<p>I think the conclusion was generally that augmentation / pseudo labelling, especially domain specific augmentation (see the paper regarding how it does artifacting, makes a lot of sense) is effective when dealing with class imbalance.   Imho, this is smart oversampling.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 2087063,
          "author_name": "Jia-Ming Lin",
          "author_url": "",
          "post_date": "2023-01-05T09:38:21.357000",
          "content": "<p>Hi, <br>\nIt seems that, choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.<br>\nBut there is one important thing the paper not answer, the sampling rate.<br>\nE.g. in over-sampling(ROS), higher pos. to neg. ratio would make the model overfit to pos.<br>\nThere is one recent paper[1], demonstrating this phenomena.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11665724%2F23f7d85d5c2233fe1dbe4cad50a4e72e%2F2023-01-05%205.31.30.png?generation=1672911121062365&amp;alt=media\" alt=\"\"><br>\nNote that, for the 4-layer case, pos:neg = 20:80(ROS-4) is the best choice.</p>\n<p>[1] The Effects of Data Sampling with Deep Learning and Highly Imbalanced Big Data, Information System Frontiers, Springer, 2020</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2087167,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-05T11:38:44.870000",
              "content": "<p><img src=\"https://i.ibb.co/nM5HBTx/Selection-476.png\" alt=\"https://i.ibb.co/nM5HBTx/Selection-476.png\"></p>\n<p>most of the paper may not be useful because  results of imbalance data is very dependent on the data itself.</p>\n<p>here is how you should analyze. see the results of the validation above, the question you should ask is that \"can you draw the distribution of an unknown test LB data?</p>\n<p>[1] the distribution of the neg validation is smooth and predictable. How i think the test LB neg is close to the black dotted line.</p>\n<p>[2] for the pos validation, it is multi modal, unpredictable , it even have empty bins. That is why results is unpredictable.</p>\n<p>on a side note:</p>\n<ol>\n<li>this is why some kaggler reports better results for low false positive model (i.e. high correct neg rate). it is more stable.</li>\n<li>compare that with the train distribution. valid neg and train neg are close</li>\n<li>besides imbalance, there is other problem (e.g. high percentage of positive samples is almost non separable from neg, note that even human radiologist have low correct rate, that is why biopsy is required)</li>\n</ol>\n<p>if you are trying to use kaggle data to create a stable CV-LB, you should ask:</p>\n<ol>\n<li>is it possible?</li>\n<li>if not, where are other strategy</li>\n</ol>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2087171,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-05T11:42:23.217000",
              "content": "<p>\"choosing sampling strategies should be depends on the dataset/scenarios, and should be hyperparameters.\"</p>\n<p>this is correct. it also depends on model.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2087382,
              "author_name": "Jia-Ming Lin",
              "author_url": "",
              "post_date": "2023-01-05T15:03:33.950000",
              "content": "<p>Thanks, your comments are very inspiring</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2076911,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-27T02:03:43.957000",
      "content": "<p>is the cat out of the bag …. anyone caught the cat ???</p>\n<p><a href=\"https://pubs.rsna.org/doi/pdf/10.1148/ryai.220072\" target=\"_blank\">https://pubs.rsna.org/doi/pdf/10.1148/ryai.220072</a><br>\nADMANI:  Annotated Digital Mammograms and Associated Non-Image Datasets<br>\nPublished Online:Dec 21 2022</p>\n<p><img src=\"https://i.ibb.co/6YSxq3h/Selection-312.png\" alt=\"https://i.ibb.co/6YSxq3h/Selection-312.png\"></p>\n<p>\" A subset of 40,000 images from 10,000 episodes will be provided for the<br>\nRadiological Society of North America Mammography Breast Cancer Detection AI Challenge,<br>\nlaunching on November 28th. The challenge training dataset will be made public when the<br>\nchallenge is launched and will remain available to researchers when the challenge concludes.<br>\nThe 10,000 episodes will be randomly selected from the dataset from a three-year period.\"</p>\n<p><a href=\"https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge\" target=\"_blank\">https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge</a><br>\n\"The dataset was contributed by mammography screening programs in Australia and the U.S. It includes detailed labels, with radiologists’ evaluations and follow-up pathology results for suspected malignancies.\"</p>\n<p>aka site1 and site2</p>\n<p>maybe NYU + ADMANI???</p>\n<p>baseline results:<br>\nhere is a paper that compares results with and without NYU pretrain model:</p>\n<p>[1] Evaluation of deep learning-based artificial intelligence techniques for breast cancer detection on mammograms: Results from a retrospective study using a BreastScreen Victoria dataset  (part of ADMANI)</p>\n<p>[2] Multi-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation</p>",
      "votes": 5,
      "replies": []
    },
    {
      "id": 2084837,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-03T19:36:40.053000",
      "content": "<p>high quality \"Breast Micro-Calcifications Dataset with Precisely Annotated Sequential Mammograms\"</p>\n<p>dataset:<br>\n<a href=\"https://zenodo.org/record/5036062\" target=\"_blank\">https://zenodo.org/record/5036062</a></p>\n<p>paper:<br>\n[1] Loizidou, K., Skouroumouni, G., Pitris, C. et al. Digital subtraction of temporally sequential mammograms for improved detection and classification of microcalcifications. Eur Radiol Exp 5, 40 (2021). <a href=\"https://doi.org/10.1186/s41747-021-00238-w\" target=\"_blank\">https://doi.org/10.1186/s41747-021-00238-w</a></p>\n<p>papers that uses this dataset:<br>\n<a href=\"https://scholar.google.com/citations?user=qadXBKAAAAAJ&amp;hl=en\" target=\"_blank\">https://scholar.google.com/citations?user=qadXBKAAAAAJ&amp;hl=en</a></p>",
      "votes": 6,
      "replies": []
    },
    {
      "id": 2054402,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-04T05:29:52.563000",
      "content": "<p>some analysis<br>\n<img src=\"https://i.ibb.co/F8vKhbt/Selection-106.png\" alt=\"https://i.ibb.co/F8vKhbt/Selection-106.png\"></p>\n<p>the sorted probability (red-black) graph gives you an idea how the sample prediction values fluctuate with different models.<br>\nthis is important when you are making ensemble and choosing threshold value in pfbeta binarization. <br>\nthe threshold must be stable over the  fluctuation.</p>",
      "votes": 5,
      "replies": [
        {
          "id": 2054726,
          "author_name": "Kirderf",
          "author_url": "",
          "post_date": "2022-12-04T11:47:35.393000",
          "content": "<p>Thanks! I see that you are using balance sampler, would be interesting compare with bce with loss weight with the same weights.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2054865,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-04T13:59:15.230000",
          "content": "<p><img src=\"https://i.ibb.co/F0XkGHD/Selection-121.png\" alt=\"https://i.ibb.co/F0XkGHD/Selection-121.png\"></p>",
          "votes": 9,
          "replies": []
        },
        {
          "id": 2055140,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-04T18:51:44.027000",
          "content": "<p>i try to understand why resolution 1024 is better than 512. I show some CAM activation results for 1024 here (but i am not sure if the model is correct)</p>\n<p><a href=\"https://ibb.co/k3175S7\"><img src=\"https://i.ibb.co/0Bt7mG7/Selection-117.png\" alt=\"Selection-117\"></a><br>\n<a href=\"https://ibb.co/fFtzwBv\"><img src=\"https://i.ibb.co/4tMnr9d/Selection-116.png\" alt=\"Selection-116\"></a></p>",
          "votes": 8,
          "replies": []
        },
        {
          "id": 2055654,
          "author_name": "YYama",
          "author_url": "",
          "post_date": "2022-12-05T09:31:50.267000",
          "content": "<p>I am not familiar with mammography findings, but perhaps the visibility of calcification, which is typical of malignant findings, is very different between 512 and 1024?<br>\nBoth of the images you posted seem to focus on the fine calcifications, which are both parapetitive.</p>\n<p>EDIT: I don't think calcification is completely specific, as it can be seen not only in breast cancer but also in benign diseases.</p>",
          "votes": 5,
          "replies": []
        },
        {
          "id": 2056120,
          "author_name": "Sohier Dane",
          "author_url": "",
          "post_date": "2022-12-05T18:40:11.017000",
          "content": "<p>I can't speak to this specific image, but to the point <a href=\"https://www.kaggle.com/yosukeyama\" target=\"_blank\">@yosukeyama</a> made it's expected that the presence of some very small features (the calcifications) might favor models that use larger images. This article might provide useful context: <a href=\"https://radiopaedia.org/articles/breast-imaging-reporting-and-data-system-bi-rads\" target=\"_blank\">https://radiopaedia.org/articles/breast-imaging-reporting-and-data-system-bi-rads</a></p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 2056132,
          "author_name": "Kirderf",
          "author_url": "",
          "post_date": "2022-12-05T19:05:44.347000",
          "content": "<p>Addition to the dim. questions, can we lose some important grey level information in the png conversion from dicom and maybe it would be better using e.g. NIfTI-format, or do we have all information needed by using windowing features?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 2057734,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-07T10:11:06.943000",
          "content": "<p>i show CAM heatmap for an external dataset with lesion annotation<br>\n<a href=\"https://vindr.ai/datasets/mammo\" target=\"_blank\">https://vindr.ai/datasets/mammo</a></p>\n<p><a href=\"https://ibb.co/dfhfDt4\"><img src=\"https://i.ibb.co/p1m1dQj/0-991211-9b28bca8f8312283e4fd9f093646b04b.png\" alt=\"0-991211-9b28bca8f8312283e4fd9f093646b04b\"></a><br>\n<a href=\"https://ibb.co/44HtqNQ\"><img src=\"https://i.ibb.co/RQqbFH5/0-958984-dec4540f406b4e556983b4f76504ee30.png\" alt=\"0-958984-dec4540f406b4e556983b4f76504ee30\"></a><br>\n<a href=\"https://ibb.co/xsTWpHb\"><img src=\"https://i.ibb.co/SxCbhrg/0-854492-19acc4b912b5637af651392bc1fe6b6e.png\" alt=\"0-854492-19acc4b912b5637af651392bc1fe6b6e\"></a><br>\n<a href=\"https://ibb.co/Fm26cjZ\"><img src=\"https://i.ibb.co/xXWhwR9/0-735352-f54b07517cb46e8a59c1c10748bdb5ed.png\" alt=\"0-735352-f54b07517cb46e8a59c1c10748bdb5ed\"></a><br>\n<a href=\"https://ibb.co/DMrXMz2\"><img src=\"https://i.ibb.co/n1P216J/0-682617-735851f234a657318773c4cbbe4969cf.png\" alt=\"0-682617-735851f234a657318773c4cbbe4969cf\"></a><br>\n<a href=\"https://ibb.co/JyL5tWZ\"><img src=\"https://i.ibb.co/yYTWPm2/0-587891-d83b16559c3ad828bd86db23e4f11243.png\" alt=\"0-587891-d83b16559c3ad828bd86db23e4f11243\"></a><br>\n<a href=\"https://ibb.co/XxfV1Sn\"><img src=\"https://i.ibb.co/8gnXq6y/0-425781-6057b80f4f3e7d18f2bac341f7a64e07.png\" alt=\"0-425781-6057b80f4f3e7d18f2bac341f7a64e07\"></a><br>\n<a href=\"https://ibb.co/XpkrPbB\"><img src=\"https://i.ibb.co/Mp5xHsT/0-371338-83be060130997ca7b67b3979978a5d29.png\" alt=\"0-371338-83be060130997ca7b67b3979978a5d29\"></a><br>\n<a href=\"https://ibb.co/SnCNx8d\"><img src=\"https://i.ibb.co/Yks2WMy/0-347656-31fcc94f3079f2b234c6e4304ab540e3.png\" alt=\"0-347656-31fcc94f3079f2b234c6e4304ab540e3\"></a><br>\n<a href=\"https://ibb.co/N64s79K\"><img src=\"https://i.ibb.co/JRhKCvH/0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9.png\" alt=\"0-289062-e45c5993ab3a5c28b0f5ed32a0c204b9\"></a><br>\n<a href=\"https://ibb.co/VxFXH9q\"><img src=\"https://i.ibb.co/YX5vDQL/0-262451-07e191bc54c3378f9fdf23ddecc47420.png\" alt=\"0-262451-07e191bc54c3378f9fdf23ddecc47420\"></a></p>\n<p>i am glad that for high predicted probability, the model (single fold 1024) performs quite well.<br>\nhowever t there are many misses. I think this is due to lack of kaggle train data.</p>\n<p>use of external will play an important part in this competition</p>",
          "votes": 7,
          "replies": []
        },
        {
          "id": 2058004,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-07T14:37:27.680000",
          "content": "<p>2048 is the king?</p>\n<p><img src=\"https://i.ibb.co/8rk2PyZ/Selection-134.png\" alt=\"https://i.ibb.co/8rk2PyZ/Selection-134.png\"></p>\n<p>anyone has good suggestion for a low-memory, low flop model that might work well for 2048?</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 2058540,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-08T02:27:18.853000",
          "content": "<p>check the distribution diagram<br>\n<a href=\"https://miro.medium.com/max/720/1*yF319EgJVzag9pd2ZL4D4Q.webp\" target=\"_blank\">https://miro.medium.com/max/720/1*yF319EgJVzag9pd2ZL4D4Q.webp</a></p>\n<p>it compare bce loss and soft-f1 loss</p>\n<p><a href=\"https://towardsdatascience.com/the-unknown-benefits-of-using-a-soft-f1-loss-in-classification-systems-753902c0105d\" target=\"_blank\">https://towardsdatascience.com/the-unknown-benefits-of-using-a-soft-f1-loss-in-classification-systems-753902c0105d</a></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2058880,
          "author_name": "Kirderf",
          "author_url": "",
          "post_date": "2022-12-08T09:28:06.033000",
          "content": "<blockquote>\n  <p>anyone has good suggestion for a low-memory, low flop model that might work well for 2048?</p>\n</blockquote>\n<p>Teacher-student architectur and knowledge distillation?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2058958,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-08T11:00:11.143000",
          "content": "<p><img src=\"https://i.ibb.co/rwkSLfG/Selection-138.png\" alt=\"https://i.ibb.co/rwkSLfG/Selection-138.png\"></p>\n<p>i added a head to learn the best probability calibration for maximizing kaggle metric F1.<br>\nIn the end, it is the same as hard binary thresholding</p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 2060543,
          "author_name": "Ankit Thummar",
          "author_url": "",
          "post_date": "2022-12-10T05:30:07.960000",
          "content": "<p>Good explanation, well🙌</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2162027,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-02-28T00:07:40.403000",
      "content": "<p>results are out!</p>\n<p>3 fold nextvit-b  has private lb 0.48.<br>\n1  fold nextvit-b  has private lb 0.45.</p>\n<p>but unfornately, i didn't select that</p>\n<p><img src=\"https://i.ibb.co/bWXKr73/Selection-999-1157.png\" alt=\"https://i.ibb.co/bWXKr73/Selection-999-1157.png\"></p>",
      "votes": 4,
      "replies": [
        {
          "id": 2162347,
          "author_name": "Rasoul Mojtahedzadeh",
          "author_url": "",
          "post_date": "2023-02-28T06:33:21.303000",
          "content": "<p>May I ask why you chose 1-fold over 3-fold solution?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2113008,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-24T02:53:04.297000",
      "content": "<p>sometimes you want to modify timms model without messing of the original  code. Here is a way to do it:</p>\n<pre><code>from timm.models.convnext import _create_convnext\n\ndef convnext_tiny(pretrained=False, **kwargs):\n    model_args = dict(depths=(3, 3, 9, 3), dims=(96, 192, 384, 768), **kwargs)\n    model = _create_convnext('convnext_tiny.in12k_ft_in1k_384', pretrained=pretrained, **model_args)\n    setattr(model, 'depths', [3, 3, 9, 3])\n    return model\n\n\n#modify to output all layers\nclass Encoder(nn.Module):\n    def __init__(self, ):\n        super(Encoder, self).__init__()\n        e = convnext_tiny(pretrained=True)\n        self.stem = e.stem\n        self.stage1 = e.stages[         0  : e.depths[0]]\n        self.stage2 = e.stages[e.depths[0] : e.depths[1]]\n        self.stage3 = e.stages[e.depths[1] : e.depths[2]]\n        self.stage4 = e.stages[e.depths[2] : e.depths[3]]\n        self.norm_pre = e.norm_pre\n        del e\n\n    def forward(self, x):\n        x0 = self.stem(x)\n        x1 = self.stage1(x0)\n        x2 = self.stage2(x1)\n        x3 = self.stage3(x2)\n        x4 = self.stage4(x3)\n        return [x1,x2,x3,x4]\n</code></pre>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 2086023,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-04T14:11:45.297000",
      "content": "<p>in order to improve the detection rate, one may want to flip some labels:<br>\ne.g. <br>\ndifficult_negative_case =1, biopsy=1 --&gt; cancer =1<br>\n(since it is sent for biopsy, it should be visually close to malignant )</p>",
      "votes": 3,
      "replies": [
        {
          "id": 2086062,
          "author_name": "Eleftherios Fanioudakis",
          "author_url": "",
          "post_date": "2023-01-04T14:40:53.137000",
          "content": "<p>tried that but no improvement. might need to add density type as well</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2084695,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-03T17:18:02.053000",
      "content": "<p><a href=\"https://github.com/nyukat/BIRADS_classifier\" target=\"_blank\">https://github.com/nyukat/BIRADS_classifier</a><br>\n<a href=\"https://cs.nyu.edu/~kgeras/reports/datav1.0.pdf\" target=\"_blank\">https://cs.nyu.edu/~kgeras/reports/datav1.0.pdf</a></p>\n<p>How to map external data to kaggle label</p>\n<p>\"As BI-RADS 0 and BI-RADS 1 and BI-RADS 2 should be the only BI-RADS categories used in screening mammography,<br>\nwe condensed all BI-RADS categories into three classes for the purposes of training our model.\" </p>\n<p>BI-RADS 0, 4a/b/c and 5 were mapped to a new ‘BI-RADS 0’ as each indicates a possibility of malignancy. <br>\nBI-RADS 1 is retained at ‘BI-RADS1’. <br>\nBI-RADS 2 and 3 are mapped to a new ‘BI-RADS 2’, as they both indicate benign findings. </p>\n<p>This procedure resulted in a dataset consisting of a single BI-RADS label over three classes for each of our valid screening mammography exams.\"</p>\n<hr>\n<p>BI-RADS categories:<br>\n0 (‘incomplete’), <br>\n1 (‘negative’), <br>\n2 (‘benign’), <br>\n3 (‘probably benign’), <br>\n4a (‘low suspicious’), <br>\n4b (‘moderate sus-picious’), <br>\n4c (‘high suspicious’) <br>\n5 (‘highly suggestive of malignancy’)<br>\n6 (‘known biopsy with proven malignancy’)</p>",
      "votes": 3,
      "replies": [
        {
          "id": 2085620,
          "author_name": "@kaggleqrdl",
          "author_url": "",
          "post_date": "2023-01-04T09:33:32.467000",
          "content": "<p>The paper you link to is from 2019, correct?  That's 3 years ago.  I wonder if they've enhanced the labelling given what's occurred since then.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2082873,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-01-02T03:44:08.533000",
      "content": "<p>results on large scale external data (vindr) is pretty much the same as kaggle data:</p>\n<p><a href=\"https://ibb.co/0GhrXTM\"><img src=\"https://i.ibb.co/3CBcs2N/Picture1.png\" alt=\"Picture1\"></a></p>",
      "votes": 3,
      "replies": [
        {
          "id": 2083835,
          "author_name": "outwrest",
          "author_url": "",
          "post_date": "2023-01-02T22:38:43.980000",
          "content": "<p>Hey, I am a novice and I have a question, did you train on Kaggle and predict on Vindr? I am trying to figure out a good CV step because I have doubts about mine. Since we are thresholding, would holdout and N-fold CV be better to find a threshold for the competition dataset? And can we use Vindr as the holdout if it is similar as you mentioned?</p>\n<p>If the Vindr dataset is very similar to Kaggle's I am sure we can use it to validate models (I think this won't go against their license since we are not training on it).</p>",
          "votes": 2,
          "replies": [
            {
              "id": 2083921,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-03T01:08:00.367000",
              "content": "<p>[1] Can Vindr be used in the solution at all?</p>\n<p>i haven't considered this yet. my current objective is to get a good way to understand the problem, training and metrics first. maybe it is possible that Vindr is not allowed and i will deal with that later. Vindr is currently investigated, because i can get benchmark results form paper and there are more annotation like bounding box, etc for experiments.</p>\n<p>[2] did you train on Kaggle and predict on Vindr?</p>\n<p>results are based on training = Vindr,  testing = Vindr. I am just repeating the paper results to confirm my pipeline  is correct.</p>\n<hr>\n<p>Even with Vindr, the metrics are not stable (both AUC and F1 score). Vindr is still not large enough. I think the reason is as follows:</p>\n<ul>\n<li><p>pure visual diagnostics from image mammography has its limitation.  Positive predictive value (PPV), aka. precision, of radiologist  in  screening is not high. that is why biopsy is needed to confirm cancer cases.</p></li>\n<li><p>that is why just only based on  visual evidence, given a choice to improve either sensitivity (tp rate) or specificity (tn rate), it is \"easier\" for the model to choose specificity. You can better metrics because there are much more neg samples (imbalance)  and more likely to be correct (given same detectable visual abnormality, it is more likely to be benign)</p></li>\n</ul>\n<p>you can google for PPV for abnormality in mammography screening  for more information </p>\n<p>Hence there is probably no good metric. and you are not likely to see good CV-LB as you would usually would in previous problems with better data. </p>\n<hr>\n<p>You will also see that for papers that conduct experiments on various datasets (instead of one), metrics on various datasets various. Results are more stable for those that uses millions of training images (from 1 million to 4 million).</p>\n<p>since you are a student, i strong encourage you to apply for those million image dataset like OPTIMAM, CSAW, AMAINDA and conduct experiments on those (but note that they cannot be used for kaggle solutions if you are aiming for prize). These are open to public but by need email request. You will get a bigger picture on stable CV. </p>\n<p>The next best thing is to read papers on those big dataset.</p>\n<hr>\n<p>Then how to approach this competition?</p>\n<p>diversity:</p>\n<ul>\n<li>different models and different solutions (not just change the backbone)</li>\n<li>more different datasets to train or validate (one or two or even three are not enough)</li>\n</ul>\n<p>\"if diverse solution agrees on diverse datasets with diverse metrics, they are probably more correct\".</p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2083930,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-03T01:18:52.607000",
              "content": "<p>Thanks for your insights, I will continue learning!</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2084004,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-01-03T04:07:33.927000",
              "content": "<p><img src=\"https://i.imgur.com/poP7qN6.png\" alt=\"https://i.imgur.com/poP7qN6.png\"></p>\n<p>an example of repeating results. you can see how the results varies</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2057901,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-07T12:42:41.050000",
      "content": "<p>mixed results of dicom intensity windowing</p>\n<p><img src=\"https://i.ibb.co/t4TFG9z/Selection-127.png\" alt=\"https://i.ibb.co/t4TFG9z/Selection-127.png\"></p>",
      "votes": 3,
      "replies": [
        {
          "id": 2079529,
          "author_name": "Gunes Evitan",
          "author_url": "",
          "post_date": "2022-12-29T11:51:14.847000",
          "content": "<p>Applying window operation on the fly is too expensive though. Maybe you can try stacking 2 different windowed output on channel dimension.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2065229,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-14T12:25:30.160000",
      "content": "<p>how to set pos weight in loss to maximize f1 score for imbalanced class<br>\n<a href=\"http://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html\" target=\"_blank\">http://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html</a></p>",
      "votes": 4,
      "replies": [
        {
          "id": 2065244,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-14T12:42:40.230000",
          "content": "<p>Balance using Sampler or loss weights … or both?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2065446,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2022-12-14T17:02:07.163000",
          "content": "<p>still experimenting. i not sure if there will be a shakeup because for the same single one-fold model + the same data that is trained differently, i can get very different lb scores of 0.39 to 0.51.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2065958,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-15T08:34:21.677000",
          "content": "<p>Do you use BalancedSampler presented in your code? If yes I think that a bit of instability in score could cause this line:</p>\n<pre><code> pos_index = np.random.choice(pos_index, self.length//self.r).reshape(-1,1)\n</code></pre>\n<p>what do you think?</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2059570,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-09T03:16:02.913000",
      "content": "<p>validation results are complementary. This means that 2048 model is improving different samples from 1024.<br>\nin particular, AUC of large image is much lower (probably improving the previous low p=0 region)<br>\npfbeta of large model is better (probably improving the previous mid p=0.5 region)</p>\n<pre><code>image-wise validation results (fold-0)\n\n\neffb2-2048\nbce_loss    AUC pfbeta\n0.09397     0.82092     0.19947 \n\neffb6-1024\nbce_loss    AUC pfbeta\n0.106  0.7949  0.263  \n</code></pre>\n<hr>\n<p>LB results of 2048</p>\n<p><img src=\"https://i.ibb.co/qpqHVhT/Selection-146.png\" alt=\"https://i.ibb.co/qpqHVhT/Selection-146.png\"></p>\n<p>when ensemble of multiple input size are used, i first  convert dicom to the largest size png with cv2.resize(). <br>\nthen, pytorch F.interpolate() function is used to create the smaller size image in net forward(). <br>\nthis is different from training and maybe the cause of poor performance?</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 2059554,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2022-12-09T02:23:49.243000",
      "content": "<p>interesting paper <br>\ncvpr2022:<br>\nEfficient Classification of Very Large Images with Tiny Objects<br>\n<a href=\"https://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf\" target=\"_blank\">https://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf</a></p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 2055186,
      "author_name": "Gabriel Lins",
      "author_url": "",
      "post_date": "2022-12-04T20:12:13.743000",
      "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> great analysis!</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 2054612,
      "author_name": "Ivan Aerlic",
      "author_url": "",
      "post_date": "2022-12-04T09:29:51.753000",
      "content": "<p><a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> I am learning a lot from these. Much appreciated.</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 2149480,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-02-18T10:58:31.413000",
      "content": "<p>some cam map thoughts:<br>\n<a href=\"https://ibb.co/Chz661w\"><img src=\"https://i.ibb.co/HnVCCFK/Selection-999-757.png\" alt=\"Selection-999-757\"></a><br>\n<a href=\"https://ibb.co/gD5Lrrp\"><img src=\"https://i.ibb.co/zSyTmmY/Selection-999-758.png\" alt=\"Selection-999-758\"></a></p>\n<p><a href=\"https://ibb.co/KXF9Kqf\"><img src=\"https://i.ibb.co/kxQhm8w/Selection-999-759.png\" alt=\"Selection-999-759\"></a><br>\n<a href=\"https://ibb.co/hsxV02P\"><img src=\"https://i.ibb.co/F6kzp8S/Selection-999-760.png\" alt=\"Selection-999-760\"></a></p>",
      "votes": 1,
      "replies": [
        {
          "id": 2149544,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2023-02-18T12:23:21.710000",
          "content": "<p>i suddenly have interesting question. maybe someone can take this as future research.<br>\nif i purposely mislabelled a negative image as positive for training, what would the CAM heatmap show? waht is the implication?</p>\n<p>how about the reverse? mislabelled pos as neg?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2152260,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-02-20T17:17:00.357000",
              "content": "<p>if may be difficult to apply multi-view learning, but you can transfer/distill knowledge via manual annotation !!!!</p>\n<p><img src=\"https://i.ibb.co/56jy09J/Selection-999-843.png\" alt=\"https://i.ibb.co/56jy09J/Selection-999-843.png\"></p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2111985,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-23T10:41:24.170000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 2146523,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-02-16T00:27:47.087000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2104723,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-18T01:51:02.153000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 2104725,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-18T01:55:38.320000",
          "content": "",
          "votes": 1,
          "replies": [
            {
              "id": 2105192,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-18T10:47:57.453000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2105370,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-18T13:04:50.827000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2079089,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-29T01:20:09.167000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2074114,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-23T18:07:27.113000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 2074131,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-23T18:29:45.433000",
          "content": "",
          "votes": 2,
          "replies": [
            {
              "id": 2074138,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-23T18:47:43.300000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2074142,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-23T19:03:14.740000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2074275,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-23T23:58:37.477000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2074300,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-24T00:44:41.017000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2074533,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-24T09:37:10.717000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2075578,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-25T15:50:59.347000",
              "content": "",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2075587,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-25T16:09:41.920000",
              "content": "",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2079075,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-29T00:30:06",
              "content": "",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2079476,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-29T10:47:41.830000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2079629,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-29T14:03:14.140000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2082758,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-01T22:28:38.853000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2081351,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-31T04:58:42.020000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2072979,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-22T15:00:21.430000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 2073046,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-22T16:08:41.213000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2146431,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-02-15T21:31:24.823000",
      "content": "",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2058060,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-07T15:38:48.123000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 2058101,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T16:04:02.807000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2058123,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T16:20:58.453000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2058315,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T19:39:55.167000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2058319,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T19:48:44.137000",
          "content": "",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2059050,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-08T12:34:10.270000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2065448,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-14T17:04:39.113000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2056581,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-06T09:10:50.410000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2100897,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-15T13:35:39.203000",
      "content": "",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2098125,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-13T08:52:42.823000",
      "content": "",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2085513,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-04T07:48:47.687000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 2086357,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-04T18:12:36.467000",
          "content": "",
          "votes": 1,
          "replies": [
            {
              "id": 2086521,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-04T20:17:42.310000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2080577,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-30T09:29:13.020000",
      "content": "",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2075918,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-26T02:09:50.057000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 2075923,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-26T02:19:42.067000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2076621,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-26T16:31:07.023000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2073809,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-23T12:55:20.397000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 2073820,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-23T12:58:08.460000",
          "content": "",
          "votes": 2,
          "replies": [
            {
              "id": 2073822,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-23T12:59:17.480000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2082383,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-01T14:12:24.840000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2072341,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-22T01:35:13.687000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 2072393,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-22T04:35:48.613000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2072447,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-22T05:41:03.653000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2072462,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-22T05:58:41.170000",
              "content": "",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2072506,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-22T06:52:30.677000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2150972,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-02-19T18:00:04.150000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2146941,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-02-16T09:00:24.653000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2129867,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-02-05T00:24:23.577000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2130117,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-02-05T06:44:36.543000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2129810,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-02-04T22:17:54.337000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2130121,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-02-05T06:46:24.800000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2123551,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-31T15:21:07.247000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2123557,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-31T15:25:05.310000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2113225,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-24T06:44:13.953000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2110198,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-22T03:35:14.880000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2110541,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-22T09:10:18.967000",
          "content": "",
          "votes": 7,
          "replies": [
            {
              "id": 2112315,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-23T14:42:36.463000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2110584,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-22T09:32:20.913000",
          "content": "",
          "votes": 15,
          "replies": [
            {
              "id": 2110595,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-22T09:48:38.780000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2107235,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-19T16:49:32.827000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2099444,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-14T12:54:09.803000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2099517,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-14T13:33:21.603000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2099550,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-01-14T13:46:42.263000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2094574,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-10T20:55:54.840000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2082104,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-01T05:33:56.760000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2084829,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-01-03T19:18:04.423000",
          "content": "",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 2082096,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-01T05:21:42.590000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2081628,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-31T13:01:31.880000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2081688,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-31T14:09:27.103000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2081690,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-31T14:11:20.613000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2081227,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-31T00:59:01.193000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2081229,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-31T01:00:53.277000",
          "content": "",
          "votes": -1,
          "replies": []
        },
        {
          "id": 2081410,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-31T06:31:08.700000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2070378,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-19T23:59:27.057000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2070396,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-20T00:50:07.277000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2070401,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-20T01:06:22.437000",
              "content": "",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2081191,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-30T22:58:02.503000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2069578,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-19T06:20:06.457000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2063377,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-12T20:26:56.597000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2063386,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-12T20:56:33.007000",
          "content": "",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2065960,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-15T08:36:35.603000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 2066692,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-16T00:37:12.427000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2062488,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-12T06:42:25.330000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2059564,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-09T03:04:17.513000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2059573,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-09T03:17:34.377000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2058746,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-08T07:12:54.957000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2058778,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-08T07:55:18.720000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2057737,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-07T10:13:25.233000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2057748,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T10:17:20.100000",
          "content": "",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2057219,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-06T21:16:35.123000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2057780,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-07T10:39:56.207000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2055504,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-05T05:59:25.733000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 2055507,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-12-05T06:00:58.243000",
          "content": "",
          "votes": 1,
          "replies": [
            {
              "id": 2069847,
              "author_name": "",
              "author_url": "",
              "post_date": "2022-12-19T11:35:13.853000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2172483,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-03-07T14:52:38.930000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2058718,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-12-08T06:31:26.887000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2054227": "many kagglers asked about my hardware to train large models. Here is it:\n\n\"All experiment results are only made possible by the Z8 by HP workstation with 2x A6000 48GB Nvidia GPU cards. With fast and large GPU cards, you can enjoy designing models and sleep early without worrying about out-of-memory errors :) \"\n\n ![https://i.ibb.co/k35LJVp/Selection-517.png](https://i.ibb.co/k35LJVp/Selection-517.png)\n\n```\nsample code:\nhttps://www.kaggle.com/code/hengck23/notebooke04a738685   \nhttps://www.kaggle.com/datasets/hengck23/for-tpu-efficientb4-debug   \n```\n\n\n",
    "2109056": "example of using rejection-based approach.\nyou can improve accuracy with less computation.\n\n```\nLB : 0.58\n  test_df0 = test_df.copy()\n  probability0 = do_predict(net0, test_df0)\n  test_df0.loc[:,'cancer_p0']=probability0\n\n\n    #---\n    t = np.percentile(probability0,65) #reject 65%\n    test_df1 = test_df0[test_df0.cancer_p0>t].reset_index(drop=True)\n    probability1 = do_predict(net1, test_df1)\n    test_df1.loc[:,'cancer_p1']=probability1\n\n    # ---\n\n\nLB : 0.59  (cv increase +0.02)\n    df = test_df0.merge(test_df1[['image_id','cancer_p1']],on='image_id',how='left')\n    df.loc[df.cancer_p1.isna(),'cancer_p1'] = df.cancer_p0\n    probability = (df.cancer_p0.values +  df.cancer_p1.values)/2\n\nnet0 and net1 are trained using same fold but different seed\n\n```\n\n![https://i.ibb.co/6szKVLc/Selection-613.png](https://i.ibb.co/6szKVLc/Selection-613.png)\n\n---\n\ntip:\n\nnet1 can also be a network that uses higher resolution, etc \n\n\n---\n[1]Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time\n\nuse larger learning rate to learn a coarse model.\nthen finetune using different seed (+ different hyperparameters, rate, weighing, etc)\n\nensemble all using the method  in [1], i.e. just average the weights of the best k-models in greedy way.\n",
    "2096760": "transformer is the king!\n\n<a href=\"https://ibb.co/5FLzVqs\"><img src=\"https://i.ibb.co/sHqDrLs/Selection-516.png\" alt=\"Selection-516\" border=\"0\"></a>\n<a href=\"https://ibb.co/8rTz5Wm\"><img src=\"https://i.ibb.co/McW8VYg/Selection-515.png\" alt=\"Selection-515\" border=\"0\"></a>\n",
    "2066638": "it turns that i have lower LB than other kagglers using efficientnet.\ni have forgotten to set the drop path rate. Here is the fixed:\n\n```\n\nefficientnet_b2(pretrained=True, drop_rate = 0.3, drop_path_rate = 0.2)\n\nrefer to timm efficientnet source code for settings of drop_rate, drop_path_rate\n```\n\nyou can use single-fold model (i.e. just one checkpoint file) to get LB >0.51. more on that later,",
    "2098821": "tensorRT timming is out !!!\n\nas claimed in the paper, nextVIT is the fastest tensorRT vision transformer (same speed as efficientnet)\n\n```\nkaggle p100 notebook timing:\n\n--------------------------------------------------\npublic LB submission tensorRT 4 hr : LB 0.56\n\n--------------------------------------------------\nlocal cv 10939 images\n\nauc 0.8936061433377303\nf1score 0.49148140396595846\n@threshold 0.30612\n\n\ntotal (end-to-end from dashboard)\nDisk 16.4/73.1 GB\n1 hr 25 min\n\nbreakdown:\n\n1. install tensorRT, etc 5 min\n\n2. decode 10939 dicom images (keep aspect to 1539, use voi_lut-apply_32fp):\nnvjpeg2k (j2k, 5118 images) 28 min\ndicomsdl (non-j2k, 5917 images, 2 thread) 24 min\n\n3. detect breast box (resnet34 segentation) 2 min\n\n4. tensorRT fp16 nextVIT-B (1539x960)\none fold, original + hflip_TTA\n\nCPU utilisation 120%,  13/13 GB\nGPU utilisation 99% , 4.5/15 GB\n23 min 21 sec (7.80799 images per sec)\n\n\n=============================================\nreference (without tensorRT):\n\nsubmission  9hr : LB 0.56\n\n4. merged_bn fp16 (1539x960)\nCPU utilisation 108%,  13/13 GB\nGPU utilisation 100% , 8.5/15 GB\n95 min 32 sec (1.90819 images per sec)\n\n```",
    "2107692": "there is a novel method to fight rare (imbalance) class\n[1] Background Splitting: Finding Rare Classes in a Sea of Background\nhttps://openaccess.thecvf.com/content/CVPR2021/papers/Mullapudi_Background_Splitting_Finding_Rare_Classes_in_a_Sea_of_Background_CVPR_2021_paper.pdf\n\nthe idea i simple randomly assign label to your background images. hence even if you sample a batch of all negative images, you will not learn to predict same class\nhttps://www.youtube.com/watch?v=I6-8mrp99sI\n\n![https://i.ibb.co/PQST7mG/Selection-594.png](https://i.ibb.co/PQST7mG/Selection-594.png)",
    "2076917": "i find the treasure !!!!\n\n![https://i.ibb.co/6tGVML0/Selection-315.png](https://i.ibb.co/6tGVML0/Selection-315.png)\n\n",
    "2069441": "![https://i.ibb.co/jGmX2RS/Selection-228.png](https://i.ibb.co/jGmX2RS/Selection-228.png)\n\nin some of the video and websites i have read, we screen  mammography images by comparing left and right images side-by-side (see image above). Instead of predicting based on single image, we use stitch of of R-L image as single input. Alternatively, we can have 2 view (2x single input) and fused them later.\n\nThe advantage is that we both have same breast density, so abnormality can stand out better",
    "2061348": "i see some (very) good improvement in using 16-bit png (instead of 8bit).\nThis is because i am not applying windowing or VOI LUT in the dim data, which itself is tricky.\n\nIt is difficult to large scale experiment (especially for kaggle submission)\nOther kagglers may want to verify this.\n\n```\ndef read_dicom_as_image(dcm_file):\n    dicom = pydicom.dcmread(dcm_file)\n    image = dicom.pixel_array  \n    image = (image - image.min()) / (image.max() - image.min()+1e-6)  #this cast to float32\n    if dicom.PhotometricInterpretation == 'MONOCHROME1':\n        image = 1 - image\n\n    return image\n\ndef parallel_process(dcm_file):\n    patient_id = dcm_file.split('/')[-2]\n    image_id   = dcm_file.split('/')[-1][:-4]\n    image = read_dicom_as_image(dcm_file)\n    image = cv2.resize(image, (image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    image = (image * 65535).astype(np.uint16)\n\n    os.makedirs(f'{png_dir}/{patient_id}', exist_ok=True)\n    cv2.imwrite(f'{png_dir}/{patient_id}/{image_id}.png',image)\n\n\nif 1:\n    Parallel(n_jobs=10)(\n        delayed(parallel_process)(f)\n        for f in tqdm(dcm_file)\n    )\n\n\n```\n\ni suspect my previous improvement of 2048 is actually from the intensity improvement\n\n\n--- \nlearnable windowing\nPractical Window Setting Optimization for Medical Image Deep Learning\nhttps://github.com/MGH-LMIC/windows_optimization\n\n\nCT Window Trainable Neural Network for Improving Intracranial Hemorrhage Detection\nhttps://ars.els-cdn.com/content/image/1-s2.0-S093336571930939X-gr2.jpg",
    "2067573": "the fastest you can go is slightly less than 3hr\ninput1024, one model single-fold efficientnetb4\n\n![https://i.ibb.co/x5DN900/Selection-206.png](https://i.ibb.co/x5DN900/Selection-206.png)\n \n```\n#share ----\ndef normalised_to_8bit(image, photometric_interpretation):\n    xmin = image.min()\n    xmax = image.max() \n    norm = np.empty_like(image, dtype=np.uint8)\n    dicomsdl.util.convert_to_uint8(image, norm, xmin, xmax)\n    if photometric_interpretation == 'MONOCHROME1':\n        norm = 255 - norm\n    return norm\n\n\n# j2k ----\nj2k_decoder = nvjpeg2k.Decoder()\ndef process_j2k(df, dcm_dir, image_dir, image_size):\n    for t, d in tqdm(df.iterrows()):\n        dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n        ds = pydicom.dcmread(dcm_file)\n        offset = ds.PixelData.find(b'\\x00\\x00\\x00\\x0C')\n        jpeg_stream = bytearray(ds.PixelData[offset:]) \n        m = j2k_decoder.decode(jpeg_stream) \n\n\n        # resize and save as png\n        m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n        m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n        cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\n...\n\n#non j2k ----\n \ndef dicomsdl_parallel_process_fn(d, dcm_dir, image_dir, image_size):\n    dcm_file = f'{dcm_dir}/{d.patient_id}/{d.image_id}.dcm'\n    ds = dicomsdl.open(dcm_file)\n    info = ds.getPixelDataInfo() \n    m = np.empty(shape=[info['Rows'], info['Cols']], dtype=info['dtype'])\n    ds.copyFrameData(0, m) \n\n    # resize and save as png\n    m = normalised_to_8bit(m, ds.PhotometricInterpretation)\n    m = cv2.resize(m, dsize=(image_size, image_size), interpolation=cv2.INTER_LINEAR)\n    cv2.imwrite(f'{image_dir}/{d.patient_id}/{d.image_id}.png', m)\n\ndef process_non_j2k(df, dcm_dir, image_dir, image_size, n_jobs):  \n    Parallel(n_jobs=n_jobs)(\n        delayed(dicomsdl_parallel_process_fn)(d, dcm_dir, image_dir, image_size)\n        for t,d in tqdm(df.iterrows())\n    )\n\n```\n\nyou probably need to retrain with images generated by dicomsdl.util.convert_to_uint8()\n\n \n\n\n",
    "2067719": "in theory, you can stitch four 1024 images (LCC,RCC,LMLO,RMLO) into a single 2048 image. Then input this into a single network and make 2 predictions for L,R",
    "2059408": "[paper] Deep Neural Networks Improve Radiologists’ Performance in Breast Cancer Screening- Nan Wu\nhttps://github.com/nyukat/breast_cancer_classifier\n\nextensive experiments for multi-view prediction (over 1 million images)\n\n<a href=\"https://ibb.co/QQpjs9P\"><img src=\"https://i.ibb.co/sRbJLjK/Selection-142.png\" alt=\"Selection-142\" border=\"0\"></a>\n<a href=\"https://ibb.co/bJNN6YT\"><img src=\"https://i.ibb.co/M6PPgKr/Selection-141.png\" alt=\"Selection-141\" border=\"0\"></a>",
    "2120459": "i tried many multiple images prediction method and below is the only one that works.\nFor nextvit-B local CV improves from 0.49 (single-image predict + mean) to 0.511 (multi-image predict) for the my first experiments:\n1. i used frozen nextvit-B image encoder (in future i would use finetune)\n2. i use only channel feature after global pool from image encoder (in future I can use local feature, i.e. feature at each x,y location)\n3. i did not use augmentation in multi-images training yet\n\nI got improvement at the first run without adjusting of hyper parameters and pipeline! \n\n----\n\nhere are more information:\nPART ONE: paper review and description of method\n\n![https://i.ibb.co/yy8bBGd/Selection-724.png] (https://i.ibb.co/yy8bBGd/Selection-724.png)\n\n[1] COVID-19 Prognosis via Self-Supervised Representation Learning and Multi-Image Prediction - A. Sriram (facebook AI),  arXiv 2020\nhttps://github.com/facebookresearch/CovidPrognosis\n\n\nPART TWO: modification for kaggle breast mammography and example notebook\ndummy code is up: https://www.kaggle.com/code/hengck23/example-of-multi-image-prediction\n\n\nPART THREE: results and analysis\nto be updated",
    "2108173": "this is a cheap way to improve resolution and works for me at local CV\n\n![https://i.ibb.co/nsPnr58/Selection-602.png](https://i.ibb.co/nsPnr58/Selection-602.png)",
    "2077872": "finally, one paper that compares oversampling, undersampling and weighted class\n<a href=\"https://ibb.co/PFvQqzb\"><img src=\"https://i.ibb.co/8NLc14R/Selection-322.png\" alt=\"Selection-322\" border=\"0\"></a>\n<a href=\"https://ibb.co/HVLnx1g\"><img src=\"https://i.ibb.co/g3bzPHg/Selection-321.png\" alt=\"Selection-321\" border=\"0\"></a>\n\n[1] Comparing Techniques for Class Imbalance in Deep LearningComparing Techniques for Class Imbalance in Deep Learning\nClassification of Breast CancerClassification of Breast Cancer\n\n\nthe only conclusion is that no conclusion can be made",
    "2076911": "is the cat out of the bag .... anyone caught the cat ???\n\nhttps://pubs.rsna.org/doi/pdf/10.1148/ryai.220072\nADMANI:  Annotated Digital Mammograms and Associated Non-Image Datasets\nPublished Online:Dec 21 2022\n\n![https://i.ibb.co/6YSxq3h/Selection-312.png](https://i.ibb.co/6YSxq3h/Selection-312.png)\n\n\" A subset of 40,000 images from 10,000 episodes will be provided for the\nRadiological Society of North America Mammography Breast Cancer Detection AI Challenge,\nlaunching on November 28th. The challenge training dataset will be made public when the\nchallenge is launched and will remain available to researchers when the challenge concludes.\nThe 10,000 episodes will be randomly selected from the dataset from a three-year period.\"\n\nhttps://www.rsna.org/education/ai-resources-and-training/ai-image-challenge\n\"The dataset was contributed by mammography screening programs in Australia and the U.S. It includes detailed labels, with radiologists’ evaluations and follow-up pathology results for suspected malignancies.\"\n\naka site1 and site2\n\nmaybe NYU + ADMANI???\n\nbaseline results:\nhere is a paper that compares results with and without NYU pretrain model:\n\n[1] Evaluation of deep learning-based artificial intelligence techniques for breast cancer detection on mammograms: Results from a retrospective study using a BreastScreen Victoria dataset  (part of ADMANI)\n\n[2] Multi-view Local Co-occurrence and Global Consistency Learning Improve Mammogram Classification Generalisation\n",
    "2084837": "high quality \"Breast Micro-Calcifications Dataset with Precisely Annotated Sequential Mammograms\"\n\ndataset:\nhttps://zenodo.org/record/5036062\n\npaper:\n[1] Loizidou, K., Skouroumouni, G., Pitris, C. et al. Digital subtraction of temporally sequential mammograms for improved detection and classification of microcalcifications. Eur Radiol Exp 5, 40 (2021). https://doi.org/10.1186/s41747-021-00238-w\n\npapers that uses this dataset:\nhttps://scholar.google.com/citations?user=qadXBKAAAAAJ&hl=en",
    "2054402": "some analysis\n![https://i.ibb.co/F8vKhbt/Selection-106.png](https://i.ibb.co/F8vKhbt/Selection-106.png)\n\nthe sorted probability (red-black) graph gives you an idea how the sample prediction values fluctuate with different models.\nthis is important when you are making ensemble and choosing threshold value in pfbeta binarization. \nthe threshold must be stable over the  fluctuation.\n",
    "2162027": "results are out!\n\n3 fold nextvit-b  has private lb 0.48.\n1  fold nextvit-b  has private lb 0.45.\n\nbut unfornately, i didn't select that\n\n![https://i.ibb.co/bWXKr73/Selection-999-1157.png](https://i.ibb.co/bWXKr73/Selection-999-1157.png)",
    "2113008": "sometimes you want to modify timms model without messing of the original  code. Here is a way to do it:\n\n```\n\nfrom timm.models.convnext import _create_convnext\n\ndef convnext_tiny(pretrained=False, **kwargs):\n\tmodel_args = dict(depths=(3, 3, 9, 3), dims=(96, 192, 384, 768), **kwargs)\n\tmodel = _create_convnext('convnext_tiny.in12k_ft_in1k_384', pretrained=pretrained, **model_args)\n\tsetattr(model, 'depths', [3, 3, 9, 3])\n\treturn model\n\n\n#modify to output all layers\nclass Encoder(nn.Module):\n\tdef __init__(self, ):\n\t\tsuper(Encoder, self).__init__()\n\t\te = convnext_tiny(pretrained=True)\n\t\tself.stem = e.stem\n\t\tself.stage1 = e.stages[         0  : e.depths[0]]\n\t\tself.stage2 = e.stages[e.depths[0] : e.depths[1]]\n\t\tself.stage3 = e.stages[e.depths[1] : e.depths[2]]\n\t\tself.stage4 = e.stages[e.depths[2] : e.depths[3]]\n\t\tself.norm_pre = e.norm_pre\n\t\tdel e\n\n\tdef forward(self, x):\n\t\tx0 = self.stem(x)\n\t\tx1 = self.stage1(x0)\n\t\tx2 = self.stage2(x1)\n\t\tx3 = self.stage3(x2)\n\t\tx4 = self.stage4(x3)\n\t\treturn [x1,x2,x3,x4]\n\n```\n",
    "2086023": "in order to improve the detection rate, one may want to flip some labels:\ne.g. \ndifficult_negative_case =1, biopsy=1 --> cancer =1\n(since it is sent for biopsy, it should be visually close to malignant )",
    "2084695": "https://github.com/nyukat/BIRADS_classifier\nhttps://cs.nyu.edu/~kgeras/reports/datav1.0.pdf\n\nHow to map external data to kaggle label\n\n\"As BI-RADS 0 and BI-RADS 1 and BI-RADS 2 should be the only BI-RADS categories used in screening mammography,\nwe condensed all BI-RADS categories into three classes for the purposes of training our model.\" \n\nBI-RADS 0, 4a/b/c and 5 were mapped to a new ‘BI-RADS 0’ as each indicates a possibility of malignancy. \nBI-RADS 1 is retained at ‘BI-RADS1’. \nBI-RADS 2 and 3 are mapped to a new ‘BI-RADS 2’, as they both indicate benign findings. \n\nThis procedure resulted in a dataset consisting of a single BI-RADS label over three classes for each of our valid screening mammography exams.\"\n\n---\n\nBI-RADS categories:\n0 (‘incomplete’), \n1 (‘negative’), \n2 (‘benign’), \n3 (‘probably benign’), \n4a (‘low suspicious’), \n4b (‘moderate sus-picious’), \n4c (‘high suspicious’) \n5 (‘highly suggestive of malignancy’)\n6 (‘known biopsy with proven malignancy’)\n\n",
    "2082873": "results on large scale external data (vindr) is pretty much the same as kaggle data:\n\n<a href=\"https://ibb.co/0GhrXTM\"><img src=\"https://i.ibb.co/3CBcs2N/Picture1.png\" alt=\"Picture1\" border=\"0\"></a>",
    "2057901": "mixed results of dicom intensity windowing\n\n![https://i.ibb.co/t4TFG9z/Selection-127.png](https://i.ibb.co/t4TFG9z/Selection-127.png)",
    "2065229": "how to set pos weight in loss to maximize f1 score for imbalanced class\nhttp://ethen8181.github.io/machine-learning/model_selection/imbalanced/imbalanced_metrics.html",
    "2059570": "validation results are complementary. This means that 2048 model is improving different samples from 1024.\nin particular, AUC of large image is much lower (probably improving the previous low p=0 region)\npfbeta of large model is better (probably improving the previous mid p=0.5 region)\n\n```\n\nimage-wise validation results (fold-0)\n\n\neffb2-2048\nbce_loss\tAUC\tpfbeta\n0.09397 \t0.82092 \t0.19947 \n\neffb6-1024\nbce_loss\tAUC\tpfbeta\n0.106  0.7949  0.263  \n\n```   \n\n---\nLB results of 2048\n\n![https://i.ibb.co/qpqHVhT/Selection-146.png](https://i.ibb.co/qpqHVhT/Selection-146.png)\n\nwhen ensemble of multiple input size are used, i first  convert dicom to the largest size png with cv2.resize(). \nthen, pytorch F.interpolate() function is used to create the smaller size image in net forward(). \nthis is different from training and maybe the cause of poor performance?",
    "2059554": "interesting paper \ncvpr2022:\nEfficient Classification of Very Large Images with Tiny Objects\nhttps://openaccess.thecvf.com/content/CVPR2022/papers/Kong_Efficient_Classification_of_Very_Large_Images_With_Tiny_Objects_CVPR_2022_paper.pdf\n",
    "2055186": "Thanks for sharing @hengck23 great analysis!",
    "2054612": "@hengck23 I am learning a lot from these. Much appreciated.",
    "2149480": "some cam map thoughts:\n<a href=\"https://ibb.co/Chz661w\"><img src=\"https://i.ibb.co/HnVCCFK/Selection-999-757.png\" alt=\"Selection-999-757\" border=\"0\"></a>\n<a href=\"https://ibb.co/gD5Lrrp\"><img src=\"https://i.ibb.co/zSyTmmY/Selection-999-758.png\" alt=\"Selection-999-758\" border=\"0\"></a>\n\n<a href=\"https://ibb.co/KXF9Kqf\"><img src=\"https://i.ibb.co/kxQhm8w/Selection-999-759.png\" alt=\"Selection-999-759\" border=\"0\"></a>\n<a href=\"https://ibb.co/hsxV02P\"><img src=\"https://i.ibb.co/F6kzp8S/Selection-999-760.png\" alt=\"Selection-999-760\" border=\"0\"></a>\n\n",
    "2111985": "i started some experiments on multi-view. this is very tricky as you are basically reducing your train and validation data since it now become \n```\nnum of train data = num of original train data / num of view\n```",
    "2104723": "i haven try this but 2 ideas work for finetunning NLP transformers may work here\n1. adversarial training (fast sign gradient method, etc)\n2.  Sharpness-Aware Minimization (SAM)\n\nboth method try to flatten the valley of the resulting loss landscape to imporve robustenss and fight overfitting.\n(or in the input space sense, try to create virtual neighbours for each train samples)\n\nreference\nhttps://github.com/juntang-zhuang/GSAM   \n\nDeBERTa: Decoding-enhanced BERT with Disentangled Attention\nhttps://arxiv.org/abs/2006.03654\n\"In addition, a new virtual adversarial training method is used for fine-tuning to improve models' generalization. We show that these techniques significantly improve the efficiency of model pre-training and the performance of both natural language understanding\"\nhttps://github.com/microsoft/DeBERTa/blob/master/DeBERTa/sift/sift.py",
    "2079089": "to crop or not to crop\n<a href=\"https://ibb.co/Y8Lymrt\"><img src=\"https://i.ibb.co/pZLRcm3/Selection-334.png\" alt=\"Selection-334\" border=\"0\"></a>",
    "2074114": "![https://i.ibb.co/Z8kbcqx/Selection-273.png](https://i.ibb.co/Z8kbcqx/Selection-273.png)\ni wonder if we have enough data for transformer solution",
    "2072979": "should the threshold for f1score binarisation varies with breast density (and/or BI-RADS)?",
    "2146431": "i find some direct differentiable loss for AUC-PR and Fbeta score.\n(in pytorch and tensorflow)\n\nthe idea is simple.\nyou  find surrogate function for FPR and TPR, which have to learn the a \"threshold parameter\" \nFPR, TPR themselves are function of a deep net, which have  \"net parameter\"  \n\nso the optimization become a min, max problem for  \"threshold parameter\"  and   \"net parameter\" \nyou can solved it via sdg with weighted classification loss\n(or you can solve in globally using linear programming)\n\npaper:\nhttps://github.com/Shlomix/global_objectives_pytorch/\nhttps://github.com/facebookresearch/pytext/blob/main/pytext/loss/loss.py\n\n\n\npaper:\n[1] Scalable Learning of Non-Decomposable Objectives\nhttps://arxiv.org/abs/1608.04802\n\n\n---\n\nbut we have an issue of imbalance. so i not sure if the method would work as well.",
    "2058060": "@hengck23 Your CV/LB gap seems huge. I'm having ~0.01 difference.\nAny idea why ?\n\nEDIT : Fixed a bug in my inference pipeline, I have a huge CV/LB gap as well now  (0.04)",
    "2056581": "Thank You for sharing @hengck23 Always Appreciated!",
    "2100897": "i made a bug and notebbok gets into infinite loop at submission.\nthis eats up my GPU hours at the beginning of the week and was unable to verify the trick below.\n\n----\n\nthe reshaping of power 0.5 trick consistently improves my CV by 0.01\nKagglers may want to verify this for LB.\n\n\n```\nbefore\n    valid_df.loc[:, 'cancer_p'] = cancer_p\n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n\n\nafter\n    valid_df.loc[:, 'cancer_p'] = cancer_p**0.5 \n    valid_df.loc[:, 'cancer_t'] = cancer_t\n    gb = valid_df[['site_id', 'patient_id','laterality', 'cancer_t', 'cancer_p']].groupby(['patient_id', 'laterality']).mean()\n    f1score, precision, recall, threshold = get_f1score(gb.cancer_p, gb.cancer_t)\n\n```\n\n",
    "2098125": "keep only the most important patch!\nWACV2023 paper\nhttps://github.com/yueliukth/PatchDropout\n\n![https://i.ibb.co/8YpxJGS/Selection-518.png](https://i.ibb.co/8YpxJGS/Selection-518.png)\n\n[1] PatchDropout: Economizing Vision Transformers Using Patch Dropout\nhttps://openaccess.thecvf.com/content/WACV2023/papers/Liu_PatchDropout_Economizing_Vision_Transformers_Using_Patch_Dropout_WACV_2023_paper.pdf\n\n",
    "2085513": "seems that site1 and site 2 are biased. do we need to separate them?\n\nsee bottom of notebook\nhttps://www.kaggle.com/code/hengck23/mvccl-model-for-admani-dataset/notebook\n\n\"there is starter code of baseline pure efficient-b0 single view here: https://www.kaggle.com/datasets/hengck23/pure-effb0-single-view-starter-for-mvccl-admani\"",
    "2080577": "cross-view attention and transformer\n\n<a href=\"https://ibb.co/ZXNC7rg\"><img src=\"https://i.ibb.co/Rb7WdK6/Selection-383.png\" alt=\"Selection-383\" border=\"0\"></a>\n<a href=\"https://ibb.co/KzbfwFW\"><img src=\"https://i.ibb.co/M5Zt6M7/Selection-382.png\" alt=\"Selection-382\" border=\"0\"></a>\n<a href=\"https://ibb.co/ZmsNWbr\"><img src=\"https://i.ibb.co/wsHYM2q/Selection-381.png\" alt=\"Selection-381\" border=\"0\"></a><br /><a target='_blank' href='https://imgbb.com/'>online free hosting</a><br />\n\n[1] https://conferences.miccai.org/2022/papers/523-Paper1238.html\n[2] https://arxiv.org/pdf/2103.11390.pdf\n\n",
    "2075918": "it seems that you can simply flip (standardize to L)  and stack the images for alignment\nall images are aligned to the common detected nipple point\n\n![https://i.ibb.co/Q7BhwpN/Selection-300.png](https://i.ibb.co/Q7BhwpN/Selection-300.png)\n\nrelated: [1] MommiNet-v2: Mammographic multi-view mass identification networks\n",
    "2073809": "![https://i.ibb.co/PZffjtW/Selection-270.png](https://i.ibb.co/PZffjtW/Selection-270.png)\ninteresting results:\nprediction on kaggle dataset using models trained on different external data",
    "2072341": "some external data results\n\n<a href=\"https://ibb.co/jftqy2P\"><img src=\"https://i.ibb.co/yP2K61c/Selection-254.png\" alt=\"Selection-254\" border=\"0\"></a>\n<a href=\"https://ibb.co/xjXSdH5\"><img src=\"https://i.ibb.co/pzbv5yX/Selection-253.png\" alt=\"Selection-253\" border=\"0\"></a>\n<a href=\"https://ibb.co/bvpkbcW\"><img src=\"https://i.ibb.co/jw7SJn6/Selection-252.png\" alt=\"Selection-252\" border=\"0\"></a>",
    "2150972": "For me on CV 0.32 single fold with optimal th@0.5. I was expecting a much better result on LB as I've seen alot of kagglers wrote, but got only 0.34. Anyone has a clue of what is happening ?",
    "2146941": "there is something very strange about site1 and site2 data\n- strong model seems to improve site2 (e.g. over 0.62) at the expense of dropping site1 (e.g. just over 0.30)\n- mid strong model has bout 0.58 for site2 and 0.46 for site1\n\ni wonder did anyone try to train a classifier to discrminate site1 and site2. if the classiifer can differentiate them, then they are different.\n\nnote that site2 has slightly more images. So it is possible that the model will take care of the majority site and sacrify the smaller one ",
    "2129867": "Thank you for your contribution. \nNoob question: (EfficientNetB2 and EfficientNetB4) are EfficientNet V1 or EfficientNetV2 ?     ",
    "2129810": "Thank you for your contribution 🙌\n1, Could you explain the different between 2 metrics: \"pfbeta\" and \"max pfbeta\"? \n2, In the \"aggregate by max() per patient-laterality\" part:\nLet's take an example: In my valid set, I have 1000 patients, each patients has 4 images, 2 images for each \"patient-laterality\". \n****So how pfbeta (logged to your table result) has calculated? **\n**I guess: 1000 patients * 4 = 4000 images => 4000 proba predicted => max() for each patient-laterality -> 2000 proba for 2000 (patient-laterality)s => 2000 pfbeta s for each (patient-laterality) -> then take mean of them\n\nThanks in advance ",
    "2123551": "came across a question relevant to this kaggle competition\n\n![https://i.ibb.co/2yvwbPL/Selection-815.png](https://i.ibb.co/2yvwbPL/Selection-815.png)\nhttps://d1.awsstatic.com/training-and-certification/docs-ml/AWS-Certified-Machine-Learning-Specialty_Sample-Questions.pdf",
    "2113225": "it is noted that mean of prediction per breast is better than individual image.\nthis means that mean prediction is a relieable self supervision signal for self supevised image learning.\n\nin thoery if we apply this to online learning on hidden test data, maybe it can lead to better results?\nof course, there will resources problem",
    "2110198": "i am wondering is there any CNN single fold or (single model) that can hit LB 0.58~0.60?\nI am thinking of discarding CNN model and just use vision transformer in my solution.",
    "2107235": "i made a bug and fold that for one fold you can re-run with different seed and ensemble for better  (and more stable?) results",
    "2099444": "Great work, that's fast! What's the local score for LB 0.58, still one fold? With that speed more fold might be tested :)",
    "2094574": "Hi, could you explain to me the binarised concept please?.\n\nThank you in advance",
    "2082104": "how to use age information?\ninstead of consider absolute value, consider something like >30 years and <30 years, etc.\nrefer to radioloogist workflow from the web",
    "2082096": "where are the cancer:\nhttps://www.youtube.com/watch?v=bH11DhzJRmA&t=2773s\nBreast Micro-calcifications : All You Need to Know | Mammography | Dr. Terry Minuk\n\nBreast Imaging: Calcifications [Basic Radiology]\nhttps://www.youtube.com/watch?v=7d3nY1ZMr9Q\n",
    "2081628": "you basically can learn the relative position encoding for cross attention\n\n![https://i.ibb.co/tsQXDCH/Selection-408.png](https://i.ibb.co/tsQXDCH/Selection-408.png)",
    "2081227": "\"The difficulty of a problem can be indicated by how quickly a human can complete the task.\"\n\nonly 0.5 sec for screening mammogram !!!\n\n[1] Radiologists can detect the ‘gist’ of breast cancer before any overt signs of cancer appear\nhttps://www.nature.com/articles/s41598-018-26100-5\n\n\". Our findings suggest that readers can distinguish patients who were diagnosed with cancer, from individuals without breast cancer (normal category), at above-chance levels based on a half-second glimpse of the mammogram even before any lesion becomes visible on the mammogram\"\n\nhuman expert here can be interpreted as having experience (i.e. see many data before) or having natural ability to spot some image characteristics (i.e. some good network architecture that model data prior distribution well) ",
    "2070378": "there is something interesting about the dicom tag ...\n\n![https://i.ibb.co/ZLQj0Ck/Selection-231.png](https://i.ibb.co/ZLQj0Ck/Selection-231.png)\n![https://i.ibb.co/ZdDWmnQ/Selection-232.png](https://i.ibb.co/ZdDWmnQ/Selection-232.png)\n\n\n```\nplt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==1], dicom_tag_df.ContentTime[dicom_tag_df.cancer==1],'o' )\nplt.plot(dicom_tag_df.ContentTime.index[dicom_tag_df.cancer==0], dicom_tag_df.ContentTime[dicom_tag_df.cancer==0],'.' )\n\n\n```",
    "2069578": "Hi @hengck23  What is different of per image with per patient-laterality?",
    "2063377": "@hengck23 I looked into your code - could you explain line \n\n```cancer =  torch.nan_to_num(cancer)```\n\nin inference prart? Any issues with nan's and efficientnet?",
    "2062488": "did you use pretrained weights?",
    "2059564": "Thanks a lot for nice work. @hengck23 \nHow many epochs have you set during training? ",
    "2058746": "Hi ! I'd like to ask about the training data. Do you take any method to deal with the imbalance of the dataset? Like using Focal loss or oversampling. Or do you just put the origin data into the training? I am sincerely looking forward to your answer.😀👋",
    "2057737": "Interesting topic as usual! Thank you for sharing your experience. \na. Looking into your tables and see numbers - what is your batch size (res -> 1024)? Have you tried to change bs to see results? \nb. Do you use ROI extracted images on resized only?",
    "2057219": "Thanks for the post @hengck23. What validation are you using? `StratifiedGroupKFold`?",
    "2055504": "@hengck23 Are the 1024 models trained first at lower resolutions or do you go straight to 1024?",
    "2172483": "Thank you for the post.",
    "2058718": "Thank you very much!"
  }
}