{
  "id": 72562,
  "title": "How to decide the size of a CNN model ?",
  "url": "/competitions/digit-recognizer/discussion/72562",
  "author_name": "Pierre-Nicolas Piquin",
  "post_date": "2018-11-24T16:23:59.499000",
  "votes": 5,
  "comment_count": 7,
  "views": null,
  "content": "<p>Hi,</p>\n\n<p>I would like to know if there are any ways to decide how big and how deep a CNN should be knowing the size of the training dataset. Is there a rule to decide that ?\nI am currently working on this MNIST dataset and I am roughly following some tutorials but if I had to create my own CNN model, I wouldn't know the numbers of layers or the size of these layers. Do I just need to get experience and try to guess that with 60 000 (28*28) images a 4 layer CNN, with something like 32 kernels at each Conv layer is enough ? too much ? too little ?\nDo I need to look at the numbers of trainable parameters ? Compare it to the dataset size ?</p>\n\n<p>If someone has any insights or references on this question it would help me a lot !!</p>",
  "messages": [
    {
      "id": 427117,
      "postDate": "2018-11-24T16:23:59.500Z",
      "content": "<p>Hi,</p>\n\n<p>I would like to know if there are any ways to decide how big and how deep a CNN should be knowing the size of the training dataset. Is there a rule to decide that ?\nI am currently working on this MNIST dataset and I am roughly following some tutorials but if I had to create my own CNN model, I wouldn't know the numbers of layers or the size of these layers. Do I just need to get experience and try to guess that with 60 000 (28*28) images a 4 layer CNN, with something like 32 kernels at each Conv layer is enough ? too much ? too little ?\nDo I need to look at the numbers of trainable parameters ? Compare it to the dataset size ?</p>\n\n<p>If someone has any insights or references on this question it would help me a lot !!</p>",
      "rawMarkdown": "Hi,\n\nI would like to know if there are any ways to decide how big and how deep a CNN should be knowing the size of the training dataset. Is there a rule to decide that ?\nI am currently working on this MNIST dataset and I am roughly following some tutorials but if I had to create my own CNN model, I wouldn't know the numbers of layers or the size of these layers. Do I just need to get experience and try to guess that with 60 000 (28*28) images a 4 layer CNN, with something like 32 kernels at each Conv layer is enough ? too much ? too little ?\nDo I need to look at the numbers of trainable parameters ? Compare it to the dataset size ?\n\nIf someone has any insights or references on this question it would help me a lot !!",
      "votes": 5
    },
    {
      "id": 428821,
      "postDate": "2018-11-28T00:05:58.390Z",
      "content": "<p>Here's a Kaggle kernel that uses a bunch of experiments to determine an optimal CNN architecture:\n<a href=\"https://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist\">https://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist</a></p>",
      "rawMarkdown": "Here's a Kaggle kernel that uses a bunch of experiments to determine an optimal CNN architecture:\nhttps://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist",
      "votes": 1
    },
    {
      "id": 427129,
      "postDate": "2018-11-24T17:00:44.887Z",
      "content": "<p>Development of neural nets architecture is actually a pretty big challenge. The best way, in my opinion, is taking some well-known architecture and reusing it. You just need to make sure that the data flow is correct in your model. For the MNIST problem, you can take LeNet, it should do the trick. </p>",
      "rawMarkdown": "Development of neural nets architecture is actually a pretty big challenge. The best way, in my opinion, is taking some well-known architecture and reusing it. You just need to make sure that the data flow is correct in your model. For the MNIST problem, you can take LeNet, it should do the trick. ",
      "votes": 1,
      "replies": [
        {
          "id": 427367,
          "postDate": "2018-11-25T11:16:25.943Z",
          "content": "<p>Thanks for the reply !\nAnd is there a place with a list of all reusable nets ?</p>",
          "rawMarkdown": "Thanks for the reply !\nAnd is there a place with a list of all reusable nets ?",
          "votes": 1
        },
        {
          "id": 427370,
          "postDate": "2018-11-25T11:26:41.187Z",
          "content": "<p>Here's a nice article that has some of the most popular ones:</p>\n\n<p><a href=\"https://medium.com/&lt;a href=\">@sidereal</a>/cnns-architectures-lenet-alexnet-vgg-googlenet-resnet-and-more-666091488df5\"&gt;https://medium.com/<a href=\"/sidereal\">@sidereal</a>/cnns-architectures-lenet-alexnet-vgg-googlenet-resnet-and-more-666091488df5</p>",
          "rawMarkdown": "Here's a nice article that has some of the most popular ones:\n\nhttps://medium.com/@sidereal/cnns-architectures-lenet-alexnet-vgg-googlenet-resnet-and-more-666091488df5",
          "votes": 1
        }
      ]
    },
    {
      "id": 1217699,
      "postDate": "2021-02-25T08:47:10.460Z",
      "content": "<p>Hello,<br>\nwe will have different accuracy every run in CNN, how can we fix initial parameters or how can we solve this problem.<br>\nthank you in advance</p>",
      "rawMarkdown": "Hello,\nwe will have different accuracy every run in CNN, how can we fix initial parameters or how can we solve this problem.\nthank you in advance"
    },
    {
      "id": 453439,
      "postDate": "2019-01-10T07:45:12.483Z",
      "content": "<p>If you are new to \"CNN/ Computer Vision\", you should first try with any standard Deep Networks available in library. For example, Keras provides a number of ready made Deep Networks like VGG, ResNet, Xception, Inception etc. One needs to just call them from library. Play with them. Next follow their implementation in GitHub and try to see their performance by changing layers/ parameters. Once you get the idea of their working and architecture, you could build your own network. Thanks.</p>",
      "rawMarkdown": "If you are new to \"CNN/ Computer Vision\", you should first try with any standard Deep Networks available in library. For example, Keras provides a number of ready made Deep Networks like VGG, ResNet, Xception, Inception etc. One needs to just call them from library. Play with them. Next follow their implementation in GitHub and try to see their performance by changing layers/ parameters. Once you get the idea of their working and architecture, you could build your own network. Thanks."
    },
    {
      "id": 435734,
      "postDate": "2018-12-08T16:46:45.870Z",
      "content": "<p>asdf</p>",
      "rawMarkdown": "asdf"
    }
  ],
  "comments": [
    {
      "id": 428821,
      "author_name": "Chris Deotte",
      "author_url": "",
      "post_date": "2018-11-28T00:05:58.390000",
      "content": "<p>Here's a Kaggle kernel that uses a bunch of experiments to determine an optimal CNN architecture:\n<a href=\"https://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist\">https://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist</a></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 427129,
      "author_name": "Mark Tselikov",
      "author_url": "",
      "post_date": "2018-11-24T17:00:44.887000",
      "content": "<p>Development of neural nets architecture is actually a pretty big challenge. The best way, in my opinion, is taking some well-known architecture and reusing it. You just need to make sure that the data flow is correct in your model. For the MNIST problem, you can take LeNet, it should do the trick. </p>",
      "votes": 1,
      "replies": [
        {
          "id": 427367,
          "author_name": "Pierre-Nicolas Piquin",
          "author_url": "",
          "post_date": "2018-11-25T11:16:25.943000",
          "content": "<p>Thanks for the reply !\nAnd is there a place with a list of all reusable nets ?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 427370,
          "author_name": "Mark Tselikov",
          "author_url": "",
          "post_date": "2018-11-25T11:26:41.187000",
          "content": "<p>Here's a nice article that has some of the most popular ones:</p>\n\n<p><a href=\"https://medium.com/&lt;a href=\">@sidereal</a>/cnns-architectures-lenet-alexnet-vgg-googlenet-resnet-and-more-666091488df5\"&gt;https://medium.com/<a href=\"/sidereal\">@sidereal</a>/cnns-architectures-lenet-alexnet-vgg-googlenet-resnet-and-more-666091488df5</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1217699,
      "author_name": "syaman",
      "author_url": "",
      "post_date": "2021-02-25T08:47:10.460000",
      "content": "<p>Hello,<br>\nwe will have different accuracy every run in CNN, how can we fix initial parameters or how can we solve this problem.<br>\nthank you in advance</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 453439,
      "author_name": "Sujoy K Goswami",
      "author_url": "",
      "post_date": "2019-01-10T07:45:12.483000",
      "content": "<p>If you are new to \"CNN/ Computer Vision\", you should first try with any standard Deep Networks available in library. For example, Keras provides a number of ready made Deep Networks like VGG, ResNet, Xception, Inception etc. One needs to just call them from library. Play with them. Next follow their implementation in GitHub and try to see their performance by changing layers/ parameters. Once you get the idea of their working and architecture, you could build your own network. Thanks.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 435734,
      "author_name": "armitage shanks",
      "author_url": "",
      "post_date": "2018-12-08T16:46:45.870000",
      "content": "<p>asdf</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "427117": "Hi,\n\nI would like to know if there are any ways to decide how big and how deep a CNN should be knowing the size of the training dataset. Is there a rule to decide that ?\nI am currently working on this MNIST dataset and I am roughly following some tutorials but if I had to create my own CNN model, I wouldn't know the numbers of layers or the size of these layers. Do I just need to get experience and try to guess that with 60 000 (28*28) images a 4 layer CNN, with something like 32 kernels at each Conv layer is enough ? too much ? too little ?\nDo I need to look at the numbers of trainable parameters ? Compare it to the dataset size ?\n\nIf someone has any insights or references on this question it would help me a lot !!",
    "428821": "Here's a Kaggle kernel that uses a bunch of experiments to determine an optimal CNN architecture:\nhttps://www.kaggle.com/cdeotte/how-to-choose-cnn-architecture-mnist",
    "427129": "Development of neural nets architecture is actually a pretty big challenge. The best way, in my opinion, is taking some well-known architecture and reusing it. You just need to make sure that the data flow is correct in your model. For the MNIST problem, you can take LeNet, it should do the trick. ",
    "1217699": "Hello,\nwe will have different accuracy every run in CNN, how can we fix initial parameters or how can we solve this problem.\nthank you in advance",
    "453439": "If you are new to \"CNN/ Computer Vision\", you should first try with any standard Deep Networks available in library. For example, Keras provides a number of ready made Deep Networks like VGG, ResNet, Xception, Inception etc. One needs to just call them from library. Play with them. Next follow their implementation in GitHub and try to see their performance by changing layers/ parameters. Once you get the idea of their working and architecture, you could build your own network. Thanks.",
    "435734": "asdf"
  }
}