{
  "id": 81882,
  "title": "ResNet50 vs other architectures more optimised for small images",
  "url": "/competitions/histopathologic-cancer-detection/discussion/81882",
  "author_name": "",
  "post_date": "2019-02-25T20:16:13.900408400Z",
  "votes": 3,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Several users have been using the ResNet50 architecture for their models. In Keras the minimum image input size to use ResNet50 is (197, 197). You can pad the (96, 96) input image up to over this threshold. But I'm not really sure what the implication of that would be on performance, I would have thought intuitively that you'd be wasting a lot of computational power on unnecessary operations. </p>\n\n<p>I was wondering whether is anyone is aware of other deep residual frameworks that don't require the padding/are more optimized for smaller image sizes. Or generally other interesting architectures for the model other than the ResNet series.</p>",
  "messages": [
    {
      "id": "478160",
      "postDate": "02/25/2019 20:16:13",
      "content": "<p>Several users have been using the ResNet50 architecture for their models. In Keras the minimum image input size to use ResNet50 is (197, 197). You can pad the (96, 96) input image up to over this threshold. But I'm not really sure what the implication of that would be on performance, I would have thought intuitively that you'd be wasting a lot of computational power on unnecessary operations. </p>\n\n<p>I was wondering whether is anyone is aware of other deep residual frameworks that don't require the padding/are more optimized for smaller image sizes. Or generally other interesting architectures for the model other than the ResNet series.</p>",
      "rawMarkdown": "Several users have been using the ResNet50 architecture for their models. In Keras the minimum image input size to use ResNet50 is (197, 197). You can pad the (96, 96) input image up to over this threshold. But I'm not really sure what the implication of that would be on performance, I would have thought intuitively that you'd be wasting a lot of computational power on unnecessary operations. \n\nI was wondering whether is anyone is aware of other deep residual frameworks that don't require the padding/are more optimized for smaller image sizes. Or generally other interesting architectures for the model other than the ResNet series.",
      "votes": null
    },
    {
      "id": "478530",
      "postDate": "02/26/2019 09:35:43",
      "content": "<p>According to keras <a href=\"https://keras.io/applications/#resnet\">doc</a> the minimum input size is (32, 32, ?). In practice, feeding (96, 96, 3) images raises no errors or warnings.</p>\n\n<p>Edit: Found where that 197 comes from. Please also have a look at <a href=\"https://github.com/keras-team/keras-applications/commit/d506dc82d0bb77158a097e23d3cb24a5eae78882\">this commit</a>.</p>",
      "rawMarkdown": "According to keras [doc](https://keras.io/applications/#resnet) the minimum input size is (32, 32, ?). In practice, feeding (96, 96, 3) images raises no errors or warnings.\n\nEdit: Found where that 197 comes from. Please also have a look at [this commit](https://github.com/keras-team/keras-applications/commit/d506dc82d0bb77158a097e23d3cb24a5eae78882).",
      "votes": null
    },
    {
      "id": "480032",
      "postDate": "02/27/2019 17:40:36",
      "content": "<p>Good find with the (32, 32). I was reading an example that said padding was needed, but evidently, they have recently updated it to work with smaller images :) </p>",
      "rawMarkdown": "Good find with the (32, 32). I was reading an example that said padding was needed, but evidently, they have recently updated it to work with smaller images :)",
      "votes": null
    },
    {
      "id": "481444",
      "postDate": "03/01/2019 12:11:27",
      "content": "<p>In the latest Keras version (i.e. 2.2.4) you can send very small patches (32,32). However, I am not sure what happens in Keras internally to deal with this small sizes (maybe they use zero padding internally?)</p>",
      "rawMarkdown": "In the latest Keras version (i.e. 2.2.4) you can send very small patches (32,32). However, I am not sure what happens in Keras internally to deal with this small sizes (maybe they use zero padding internally?)",
      "votes": null
    },
    {
      "id": "481682",
      "postDate": "03/01/2019 17:59:20",
      "content": "<p>(32, 32, ?) is dealt with internally just the same as (224, 224, ?), no extra paddings involved.\n(32, 32, ?) outputs (1, 1, ?); (224, 224, ?) outputs (7, 7, ?).</p>",
      "rawMarkdown": "(32, 32, ?) is dealt with internally just the same as (224, 224, ?), no extra paddings involved.\n(32, 32, ?) outputs (1, 1, ?); (224, 224, ?) outputs (7, 7, ?).",
      "votes": null
    },
    {
      "id": "482623",
      "postDate": "03/03/2019 11:54:08",
      "content": "<p>You can just feed in the input tensor and Keras takes care of the rest:\ninputs = Input(shape=(96,96, 3))\nbase_model = ResNet50(include_top=False, input_tensor=inputs, weights=\"imagenet\")</p>",
      "rawMarkdown": "You can just feed in the input tensor and Keras takes care of the rest:\ninputs = Input(shape=(96,96, 3))\nbase_model = ResNet50(include_top=False, input_tensor=inputs, weights=\"imagenet\")",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 478530,
      "author_name": "realethanzou",
      "author_url": "",
      "post_date": "02/26/2019 09:35:43",
      "content": "<p>According to keras <a href=\"https://keras.io/applications/#resnet\">doc</a> the minimum input size is (32, 32, ?). In practice, feeding (96, 96, 3) images raises no errors or warnings.</p>\n\n<p>Edit: Found where that 197 comes from. Please also have a look at <a href=\"https://github.com/keras-team/keras-applications/commit/d506dc82d0bb77158a097e23d3cb24a5eae78882\">this commit</a>.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 480032,
      "author_name": "oliverboom",
      "author_url": "",
      "post_date": "02/27/2019 17:40:36",
      "content": "<p>Good find with the (32, 32). I was reading an example that said padding was needed, but evidently, they have recently updated it to work with smaller images :) </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 481444,
      "author_name": "ipateam",
      "author_url": "",
      "post_date": "03/01/2019 12:11:27",
      "content": "<p>In the latest Keras version (i.e. 2.2.4) you can send very small patches (32,32). However, I am not sure what happens in Keras internally to deal with this small sizes (maybe they use zero padding internally?)</p>",
      "votes": null,
      "replies": [
        {
          "id": 481682,
          "author_name": "realethanzou",
          "author_url": "",
          "post_date": "03/01/2019 17:59:20",
          "content": "<p>(32, 32, ?) is dealt with internally just the same as (224, 224, ?), no extra paddings involved.\n(32, 32, ?) outputs (1, 1, ?); (224, 224, ?) outputs (7, 7, ?).</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 482623,
      "author_name": "franchini",
      "author_url": "",
      "post_date": "03/03/2019 11:54:08",
      "content": "<p>You can just feed in the input tensor and Keras takes care of the rest:\ninputs = Input(shape=(96,96, 3))\nbase_model = ResNet50(include_top=False, input_tensor=inputs, weights=\"imagenet\")</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "478160": "Several users have been using the ResNet50 architecture for their models. In Keras the minimum image input size to use ResNet50 is (197, 197). You can pad the (96, 96) input image up to over this threshold. But I'm not really sure what the implication of that would be on performance, I would have thought intuitively that you'd be wasting a lot of computational power on unnecessary operations. \n\nI was wondering whether is anyone is aware of other deep residual frameworks that don't require the padding/are more optimized for smaller image sizes. Or generally other interesting architectures for the model other than the ResNet series.",
    "478530": "According to keras [doc](https://keras.io/applications/#resnet) the minimum input size is (32, 32, ?). In practice, feeding (96, 96, 3) images raises no errors or warnings.\n\nEdit: Found where that 197 comes from. Please also have a look at [this commit](https://github.com/keras-team/keras-applications/commit/d506dc82d0bb77158a097e23d3cb24a5eae78882).",
    "480032": "Good find with the (32, 32). I was reading an example that said padding was needed, but evidently, they have recently updated it to work with smaller images :)",
    "481444": "In the latest Keras version (i.e. 2.2.4) you can send very small patches (32,32). However, I am not sure what happens in Keras internally to deal with this small sizes (maybe they use zero padding internally?)",
    "481682": "(32, 32, ?) is dealt with internally just the same as (224, 224, ?), no extra paddings involved.\n(32, 32, ?) outputs (1, 1, ?); (224, 224, ?) outputs (7, 7, ?).",
    "482623": "You can just feed in the input tensor and Keras takes care of the rest:\ninputs = Input(shape=(96,96, 3))\nbase_model = ResNet50(include_top=False, input_tensor=inputs, weights=\"imagenet\")"
  },
  "source": "meta"
}