{
  "id": 225871,
  "title": "About Image Augmentation ",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/225871",
  "author_name": "GitMach",
  "post_date": "2021-03-14T12:01:00.578000",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi, </p>\n<p>I've a question regarding image augmentation with opencv.<br>\nWe can use several functions from OpenCV (i.e.</p>\n<ul>\n<li>Horizontal Shift</li>\n<li>Vertical Shift</li>\n<li>Brightness</li>\n<li>Zoom and others) right?<br>\nEverytime we run one of this functions in one images, we get a new \"Mask\" meaning, a new vector, right ? I mean, If a apply an Horizontal shift in my \"images_dataset\" I get a vector<br>\nIf I apply Vertical shift I get another vector  different from the previous one<br>\nIf apply Brightness, we get another vector, and so on Right ?<br>\nNow, Question :<br>\nWhich vector resulting from the image augmentation shall we train our Model ?<br>\nShall we train a model for each image augmentation ? (e.g shall we apply Horizontal Shift then train a model and again apply a vertical shit and train another model ?) I mean, each time <strong>we apply a function augmentation on original datasource</strong><br>\nor<br>\nShall we \"chain\" the process (e.g we start training a model with no augmentation, then we apply Horizontal Shift  and train another model and evaluate, then apply Vertical Shift <strong>to previous tensor</strong>, train another model, evaluate… and so on?<br>\nor<br>\nshall we stack each vector from each image augmentation ? if we stack each vector we'll get a different dimension, <br>\nThank you for you comments </li>\n</ul>",
  "messages": [
    {
      "id": 1238077,
      "postDate": "2021-03-14T16:23:11.920Z",
      "content": "<p>You can look at <a href=\"https://albumentations.readthedocs.io/en/latest/index.html\" target=\"_blank\">this</a> library for doing many types of augmentations. It's the most commonly used library for this task.</p>",
      "rawMarkdown": "You can look at [this](https://albumentations.readthedocs.io/en/latest/index.html) library for doing many types of augmentations. It's the most commonly used library for this task.",
      "votes": 1
    },
    {
      "id": 1237923,
      "postDate": "2021-03-14T13:57:49.637Z",
      "content": "<p>I guess you can do different strategies how to apply augmentations, but I think the most common one is to set a probability how likely an augmentation is done each time an image is called. If you train for many epochs, at some point each augmentation will be done on each image. </p>\n<p>Check out this tutorial for example, as there are also very good libraries for doing augmentations: <a href=\"https://albumentations.ai/docs/examples/pytorch_classification/\" target=\"_blank\">https://albumentations.ai/docs/examples/pytorch_classification/</a></p>",
      "rawMarkdown": "I guess you can do different strategies how to apply augmentations, but I think the most common one is to set a probability how likely an augmentation is done each time an image is called. If you train for many epochs, at some point each augmentation will be done on each image. \n\nCheck out this tutorial for example, as there are also very good libraries for doing augmentations: https://albumentations.ai/docs/examples/pytorch_classification/",
      "votes": 1
    },
    {
      "id": 1237724,
      "postDate": "2021-03-14T12:01:00.577Z",
      "content": "<p>Hi, </p>\n<p>I've a question regarding image augmentation with opencv.<br>\nWe can use several functions from OpenCV (i.e.</p>\n<ul>\n<li>Horizontal Shift</li>\n<li>Vertical Shift</li>\n<li>Brightness</li>\n<li>Zoom and others) right?<br>\nEverytime we run one of this functions in one images, we get a new \"Mask\" meaning, a new vector, right ? I mean, If a apply an Horizontal shift in my \"images_dataset\" I get a vector<br>\nIf I apply Vertical shift I get another vector  different from the previous one<br>\nIf apply Brightness, we get another vector, and so on Right ?<br>\nNow, Question :<br>\nWhich vector resulting from the image augmentation shall we train our Model ?<br>\nShall we train a model for each image augmentation ? (e.g shall we apply Horizontal Shift then train a model and again apply a vertical shit and train another model ?) I mean, each time <strong>we apply a function augmentation on original datasource</strong><br>\nor<br>\nShall we \"chain\" the process (e.g we start training a model with no augmentation, then we apply Horizontal Shift  and train another model and evaluate, then apply Vertical Shift <strong>to previous tensor</strong>, train another model, evaluate… and so on?<br>\nor<br>\nshall we stack each vector from each image augmentation ? if we stack each vector we'll get a different dimension, <br>\nThank you for you comments </li>\n</ul>",
      "rawMarkdown": "Hi, \n\nI've a question regarding image augmentation with opencv.\nWe can use several functions from OpenCV (i.e.\n- Horizontal Shift\n- Vertical Shift\n- Brightness\n- Zoom and others) right?\nEverytime we run one of this functions in one images, we get a new \"Mask\" meaning, a new vector, right ? I mean, If a apply an Horizontal shift in my \"images_dataset\" I get a vector\nIf I apply Vertical shift I get another vector  different from the previous one\nIf apply Brightness, we get another vector, and so on Right ?\nNow, Question :\nWhich vector resulting from the image augmentation shall we train our Model ?\nShall we train a model for each image augmentation ? (e.g shall we apply Horizontal Shift then train a model and again apply a vertical shit and train another model ?) I mean, each time **we apply a function augmentation on original datasource**\nor\nShall we \"chain\" the process (e.g we start training a model with no augmentation, then we apply Horizontal Shift  and train another model and evaluate, then apply Vertical Shift **to previous tensor**, train another model, evaluate... and so on?\nor\nshall we stack each vector from each image augmentation ? if we stack each vector we'll get a different dimension, \nThank you for you comments \n",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 1238077,
      "author_name": "Vladislav Ostankovich",
      "author_url": "",
      "post_date": "2021-03-14T16:23:11.920000",
      "content": "<p>You can look at <a href=\"https://albumentations.readthedocs.io/en/latest/index.html\" target=\"_blank\">this</a> library for doing many types of augmentations. It's the most commonly used library for this task.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1237923,
      "author_name": "Alexander Riedel",
      "author_url": "",
      "post_date": "2021-03-14T13:57:49.637000",
      "content": "<p>I guess you can do different strategies how to apply augmentations, but I think the most common one is to set a probability how likely an augmentation is done each time an image is called. If you train for many epochs, at some point each augmentation will be done on each image. </p>\n<p>Check out this tutorial for example, as there are also very good libraries for doing augmentations: <a href=\"https://albumentations.ai/docs/examples/pytorch_classification/\" target=\"_blank\">https://albumentations.ai/docs/examples/pytorch_classification/</a></p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1238077": "You can look at [this](https://albumentations.readthedocs.io/en/latest/index.html) library for doing many types of augmentations. It's the most commonly used library for this task.",
    "1237923": "I guess you can do different strategies how to apply augmentations, but I think the most common one is to set a probability how likely an augmentation is done each time an image is called. If you train for many epochs, at some point each augmentation will be done on each image. \n\nCheck out this tutorial for example, as there are also very good libraries for doing augmentations: https://albumentations.ai/docs/examples/pytorch_classification/",
    "1237724": "Hi, \n\nI've a question regarding image augmentation with opencv.\nWe can use several functions from OpenCV (i.e.\n- Horizontal Shift\n- Vertical Shift\n- Brightness\n- Zoom and others) right?\nEverytime we run one of this functions in one images, we get a new \"Mask\" meaning, a new vector, right ? I mean, If a apply an Horizontal shift in my \"images_dataset\" I get a vector\nIf I apply Vertical shift I get another vector  different from the previous one\nIf apply Brightness, we get another vector, and so on Right ?\nNow, Question :\nWhich vector resulting from the image augmentation shall we train our Model ?\nShall we train a model for each image augmentation ? (e.g shall we apply Horizontal Shift then train a model and again apply a vertical shit and train another model ?) I mean, each time **we apply a function augmentation on original datasource**\nor\nShall we \"chain\" the process (e.g we start training a model with no augmentation, then we apply Horizontal Shift  and train another model and evaluate, then apply Vertical Shift **to previous tensor**, train another model, evaluate... and so on?\nor\nshall we stack each vector from each image augmentation ? if we stack each vector we'll get a different dimension, \nThank you for you comments \n"
  }
}