{
  "id": 381662,
  "title": "How to label the cancer and no cancer images to train my model?",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/381662",
  "author_name": "Alex Luna",
  "post_date": "2023-01-27T16:45:40.883000",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I was making the EDA using the .csv files and all of that but now i want to train the model, as my limited knowledge i was thinking about using the dataframe of the .csv files and concatenate the images in a tensor to be introduced in my model as an input, but i dont know how to make the relation between the cancer label to the image with cancer, maybe is a misunderstanding of the theory about deep learning models, if there is someone who knows how to do that or can clarify it i would be so grateful (im learning about DL models).</p>",
  "messages": [
    {
      "id": 2117990,
      "postDate": "2023-01-27T17:33:52.007Z",
      "content": "<p>Sure, the provided <code>train.csv</code> gives you a <code>cancer</code> column which contains a bunch of 0's and 1's for negative and positive cases. It also gives you other identifying information such as <code>image_id</code> and <code>patient_id</code>.</p>\n<p>The image file locations are as such: <code>train_images/&lt;patient_id&gt;/&lt;image_id&gt;.dcm</code></p>\n<p>What you need to do is map the cancer scores from the <code>train.csv</code> to the correct images.</p>\n<p>I highly recommend using a generator rather than pre-loading the entire image dataset onto your ram. Look into <a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/utils/image_dataset_from_directory\" target=\"_blank\">image_dataset_from_directory</a> for Keras. Depending on what packages you are using this may be beneficial.</p>",
      "rawMarkdown": "Sure, the provided `train.csv` gives you a `cancer` column which contains a bunch of 0's and 1's for negative and positive cases. It also gives you other identifying information such as `image_id` and `patient_id`.\n\nThe image file locations are as such: `train_images/<patient_id>/<image_id>.dcm`\n\nWhat you need to do is map the cancer scores from the `train.csv` to the correct images.\n\nI highly recommend using a generator rather than pre-loading the entire image dataset onto your ram. Look into [image_dataset_from_directory](https://www.tensorflow.org/api_docs/python/tf/keras/utils/image_dataset_from_directory) for Keras. Depending on what packages you are using this may be beneficial.",
      "votes": 1,
      "replies": [
        {
          "id": 2119572,
          "postDate": "2023-01-28T22:38:51.630Z",
          "content": "<p>Thanks for the info, i will try that.</p>",
          "rawMarkdown": "Thanks for the info, i will try that.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2117928,
      "postDate": "2023-01-27T16:45:40.883Z",
      "content": "<p>I was making the EDA using the .csv files and all of that but now i want to train the model, as my limited knowledge i was thinking about using the dataframe of the .csv files and concatenate the images in a tensor to be introduced in my model as an input, but i dont know how to make the relation between the cancer label to the image with cancer, maybe is a misunderstanding of the theory about deep learning models, if there is someone who knows how to do that or can clarify it i would be so grateful (im learning about DL models).</p>",
      "rawMarkdown": "I was making the EDA using the .csv files and all of that but now i want to train the model, as my limited knowledge i was thinking about using the dataframe of the .csv files and concatenate the images in a tensor to be introduced in my model as an input, but i dont know how to make the relation between the cancer label to the image with cancer, maybe is a misunderstanding of the theory about deep learning models, if there is someone who knows how to do that or can clarify it i would be so grateful (im learning about DL models).",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 2117990,
      "author_name": "AbdouE",
      "author_url": "",
      "post_date": "2023-01-27T17:33:52.007000",
      "content": "<p>Sure, the provided <code>train.csv</code> gives you a <code>cancer</code> column which contains a bunch of 0's and 1's for negative and positive cases. It also gives you other identifying information such as <code>image_id</code> and <code>patient_id</code>.</p>\n<p>The image file locations are as such: <code>train_images/&lt;patient_id&gt;/&lt;image_id&gt;.dcm</code></p>\n<p>What you need to do is map the cancer scores from the <code>train.csv</code> to the correct images.</p>\n<p>I highly recommend using a generator rather than pre-loading the entire image dataset onto your ram. Look into <a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/utils/image_dataset_from_directory\" target=\"_blank\">image_dataset_from_directory</a> for Keras. Depending on what packages you are using this may be beneficial.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2119572,
          "author_name": "Alex Luna",
          "author_url": "",
          "post_date": "2023-01-28T22:38:51.630000",
          "content": "<p>Thanks for the info, i will try that.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2117990": "Sure, the provided `train.csv` gives you a `cancer` column which contains a bunch of 0's and 1's for negative and positive cases. It also gives you other identifying information such as `image_id` and `patient_id`.\n\nThe image file locations are as such: `train_images/<patient_id>/<image_id>.dcm`\n\nWhat you need to do is map the cancer scores from the `train.csv` to the correct images.\n\nI highly recommend using a generator rather than pre-loading the entire image dataset onto your ram. Look into [image_dataset_from_directory](https://www.tensorflow.org/api_docs/python/tf/keras/utils/image_dataset_from_directory) for Keras. Depending on what packages you are using this may be beneficial.",
    "2117928": "I was making the EDA using the .csv files and all of that but now i want to train the model, as my limited knowledge i was thinking about using the dataframe of the .csv files and concatenate the images in a tensor to be introduced in my model as an input, but i dont know how to make the relation between the cancer label to the image with cancer, maybe is a misunderstanding of the theory about deep learning models, if there is someone who knows how to do that or can clarify it i would be so grateful (im learning about DL models)."
  }
}