Adding batch normalization layer to VGG16 network The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsConvolutional neural network overfitting. Dropout not helpingNeural network for peak identification problem not training successfullyFinal layer of neural network responsible for overfittingHow to make output dimensions match input dimensions in CNN?Reshape output of convolutional layer to which dimensions?Visualizing ConvNet filters using my own fine-tuned network resulting in a “NoneType” when running: K.gradients(loss, model.input)[0]Custom loss function which is included gradient in KerasValue of loss and accuracy does not change over EpochsMultiple-input multiple-output CNN with custom loss functionUnderstanding LSTM structure

First use of “packing” as in carrying a gun

Am I ethically obligated to go into work on an off day if the reason is sudden?

Would it be possible to rearrange a dragon's flight muscle to somewhat circumvent the square-cube law?

What is special about square numbers here?

Create an outline of font

How do you keep chess fun when your opponent constantly beats you?

A pet rabbit called Belle

Does Parliament hold absolute power in the UK?

What aspect of planet Earth must be changed to prevent the industrial revolution?

Difference between "generating set" and free product?

How do I add random spotting to the same face in cycles?

Keeping a retro style to sci-fi spaceships?

Can the DM override racial traits?

Are my PIs rude or am I just being too sensitive?

Did the new image of black hole confirm the general theory of relativity?

How should I replace vector<uint8_t>::const_iterator in an API?

Can withdrawing asylum be illegal?

Can smartphones with the same camera sensor have different image quality?

Did God make two great lights or did He make the great light two?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

Relations between two reciprocal partial derivatives?

How to test the equality of two Pearson correlation coefficients computed from the same sample?

How are presidential pardons supposed to be used?

He got a vote 80% that of Emmanuel Macron’s



Adding batch normalization layer to VGG16 network



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsConvolutional neural network overfitting. Dropout not helpingNeural network for peak identification problem not training successfullyFinal layer of neural network responsible for overfittingHow to make output dimensions match input dimensions in CNN?Reshape output of convolutional layer to which dimensions?Visualizing ConvNet filters using my own fine-tuned network resulting in a “NoneType” when running: K.gradients(loss, model.input)[0]Custom loss function which is included gradient in KerasValue of loss and accuracy does not change over EpochsMultiple-input multiple-output CNN with custom loss functionUnderstanding LSTM structure










1












$begingroup$


I want to use batch normalization layer to decrease overfitting in VGG16 CNN.



Where should the batch normalization layer be added to the network?



`_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_1 (InputLayer) (None, 224, 224, 3) 0
_________________________________________________________________
block1_conv1 (Conv2D) (None, 224, 224, 64) 1792
_________________________________________________________________
block1_conv2 (Conv2D) (None, 224, 224, 64) 36928
_________________________________________________________________
block1_pool (MaxPooling2D) (None, 112, 112, 64) 0
_________________________________________________________________
block2_conv1 (Conv2D) (None, 112, 112, 128) 73856
_________________________________________________________________
block2_conv2 (Conv2D) (None, 112, 112, 128) 147584
_________________________________________________________________
block2_pool (MaxPooling2D) (None, 56, 56, 128) 0
_________________________________________________________________
block3_conv1 (Conv2D) (None, 56, 56, 256) 295168
_________________________________________________________________
block3_conv2 (Conv2D) (None, 56, 56, 256) 590080
_________________________________________________________________
block3_conv3 (Conv2D) (None, 56, 56, 256) 590080
_________________________________________________________________
block3_pool (MaxPooling2D) (None, 28, 28, 256) 0
_________________________________________________________________
block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160
_________________________________________________________________
block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808
_________________________________________________________________
block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808
_________________________________________________________________
block4_pool (MaxPooling2D) (None, 14, 14, 512) 0
_________________________________________________________________
block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808
_________________________________________________________________
block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808
_________________________________________________________________
block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808
_________________________________________________________________
block5_pool (MaxPooling2D) (None, 7, 7, 512) 0
_________________________________________________________________
flatten (Flatten) (None, 25088) 0
_________________________________________________________________
fc1 (Dense) (None, 4096) 102764544
_________________________________________________________________
fc2 (Dense) (None, 4096) 16781312
_________________________________________________________________
predictions (Dense) (None, 1000) 4097000
=================================================================`









share|improve this question











$endgroup$




bumped to the homepage by Community 31 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.



















    1












    $begingroup$


    I want to use batch normalization layer to decrease overfitting in VGG16 CNN.



    Where should the batch normalization layer be added to the network?



    `_________________________________________________________________
    Layer (type) Output Shape Param #
    =================================================================
    input_1 (InputLayer) (None, 224, 224, 3) 0
    _________________________________________________________________
    block1_conv1 (Conv2D) (None, 224, 224, 64) 1792
    _________________________________________________________________
    block1_conv2 (Conv2D) (None, 224, 224, 64) 36928
    _________________________________________________________________
    block1_pool (MaxPooling2D) (None, 112, 112, 64) 0
    _________________________________________________________________
    block2_conv1 (Conv2D) (None, 112, 112, 128) 73856
    _________________________________________________________________
    block2_conv2 (Conv2D) (None, 112, 112, 128) 147584
    _________________________________________________________________
    block2_pool (MaxPooling2D) (None, 56, 56, 128) 0
    _________________________________________________________________
    block3_conv1 (Conv2D) (None, 56, 56, 256) 295168
    _________________________________________________________________
    block3_conv2 (Conv2D) (None, 56, 56, 256) 590080
    _________________________________________________________________
    block3_conv3 (Conv2D) (None, 56, 56, 256) 590080
    _________________________________________________________________
    block3_pool (MaxPooling2D) (None, 28, 28, 256) 0
    _________________________________________________________________
    block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160
    _________________________________________________________________
    block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808
    _________________________________________________________________
    block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808
    _________________________________________________________________
    block4_pool (MaxPooling2D) (None, 14, 14, 512) 0
    _________________________________________________________________
    block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808
    _________________________________________________________________
    block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808
    _________________________________________________________________
    block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808
    _________________________________________________________________
    block5_pool (MaxPooling2D) (None, 7, 7, 512) 0
    _________________________________________________________________
    flatten (Flatten) (None, 25088) 0
    _________________________________________________________________
    fc1 (Dense) (None, 4096) 102764544
    _________________________________________________________________
    fc2 (Dense) (None, 4096) 16781312
    _________________________________________________________________
    predictions (Dense) (None, 1000) 4097000
    =================================================================`









    share|improve this question











    $endgroup$




    bumped to the homepage by Community 31 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      1












      1








      1


      1



      $begingroup$


      I want to use batch normalization layer to decrease overfitting in VGG16 CNN.



      Where should the batch normalization layer be added to the network?



      `_________________________________________________________________
      Layer (type) Output Shape Param #
      =================================================================
      input_1 (InputLayer) (None, 224, 224, 3) 0
      _________________________________________________________________
      block1_conv1 (Conv2D) (None, 224, 224, 64) 1792
      _________________________________________________________________
      block1_conv2 (Conv2D) (None, 224, 224, 64) 36928
      _________________________________________________________________
      block1_pool (MaxPooling2D) (None, 112, 112, 64) 0
      _________________________________________________________________
      block2_conv1 (Conv2D) (None, 112, 112, 128) 73856
      _________________________________________________________________
      block2_conv2 (Conv2D) (None, 112, 112, 128) 147584
      _________________________________________________________________
      block2_pool (MaxPooling2D) (None, 56, 56, 128) 0
      _________________________________________________________________
      block3_conv1 (Conv2D) (None, 56, 56, 256) 295168
      _________________________________________________________________
      block3_conv2 (Conv2D) (None, 56, 56, 256) 590080
      _________________________________________________________________
      block3_conv3 (Conv2D) (None, 56, 56, 256) 590080
      _________________________________________________________________
      block3_pool (MaxPooling2D) (None, 28, 28, 256) 0
      _________________________________________________________________
      block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160
      _________________________________________________________________
      block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808
      _________________________________________________________________
      block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808
      _________________________________________________________________
      block4_pool (MaxPooling2D) (None, 14, 14, 512) 0
      _________________________________________________________________
      block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_pool (MaxPooling2D) (None, 7, 7, 512) 0
      _________________________________________________________________
      flatten (Flatten) (None, 25088) 0
      _________________________________________________________________
      fc1 (Dense) (None, 4096) 102764544
      _________________________________________________________________
      fc2 (Dense) (None, 4096) 16781312
      _________________________________________________________________
      predictions (Dense) (None, 1000) 4097000
      =================================================================`









      share|improve this question











      $endgroup$




      I want to use batch normalization layer to decrease overfitting in VGG16 CNN.



      Where should the batch normalization layer be added to the network?



      `_________________________________________________________________
      Layer (type) Output Shape Param #
      =================================================================
      input_1 (InputLayer) (None, 224, 224, 3) 0
      _________________________________________________________________
      block1_conv1 (Conv2D) (None, 224, 224, 64) 1792
      _________________________________________________________________
      block1_conv2 (Conv2D) (None, 224, 224, 64) 36928
      _________________________________________________________________
      block1_pool (MaxPooling2D) (None, 112, 112, 64) 0
      _________________________________________________________________
      block2_conv1 (Conv2D) (None, 112, 112, 128) 73856
      _________________________________________________________________
      block2_conv2 (Conv2D) (None, 112, 112, 128) 147584
      _________________________________________________________________
      block2_pool (MaxPooling2D) (None, 56, 56, 128) 0
      _________________________________________________________________
      block3_conv1 (Conv2D) (None, 56, 56, 256) 295168
      _________________________________________________________________
      block3_conv2 (Conv2D) (None, 56, 56, 256) 590080
      _________________________________________________________________
      block3_conv3 (Conv2D) (None, 56, 56, 256) 590080
      _________________________________________________________________
      block3_pool (MaxPooling2D) (None, 28, 28, 256) 0
      _________________________________________________________________
      block4_conv1 (Conv2D) (None, 28, 28, 512) 1180160
      _________________________________________________________________
      block4_conv2 (Conv2D) (None, 28, 28, 512) 2359808
      _________________________________________________________________
      block4_conv3 (Conv2D) (None, 28, 28, 512) 2359808
      _________________________________________________________________
      block4_pool (MaxPooling2D) (None, 14, 14, 512) 0
      _________________________________________________________________
      block5_conv1 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_conv2 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_conv3 (Conv2D) (None, 14, 14, 512) 2359808
      _________________________________________________________________
      block5_pool (MaxPooling2D) (None, 7, 7, 512) 0
      _________________________________________________________________
      flatten (Flatten) (None, 25088) 0
      _________________________________________________________________
      fc1 (Dense) (None, 4096) 102764544
      _________________________________________________________________
      fc2 (Dense) (None, 4096) 16781312
      _________________________________________________________________
      predictions (Dense) (None, 1000) 4097000
      =================================================================`






      machine-learning neural-network deep-learning keras cnn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 13 '18 at 15:38









      Vaalizaadeh

      7,58562263




      7,58562263










      asked Sep 6 '18 at 14:31









      N.ITN.IT

      473112




      473112





      bumped to the homepage by Community 31 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 31 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          The main purpose of batch normalisation is not for dealing with overfitting but if you have small batches while training it can have regularization effect. In the paper that it was introduced for dealing with covariat shift, it was mentioned that it should be used before activation function. Consequently, you can use it both in convolutional layers and dense layers, after employing weights and before activation functions. But I've seen people using that after activation function. It can also be used there.






          share|improve this answer









          $endgroup$













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "557"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f37889%2fadding-batch-normalization-layer-to-vgg16-network%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0












            $begingroup$

            The main purpose of batch normalisation is not for dealing with overfitting but if you have small batches while training it can have regularization effect. In the paper that it was introduced for dealing with covariat shift, it was mentioned that it should be used before activation function. Consequently, you can use it both in convolutional layers and dense layers, after employing weights and before activation functions. But I've seen people using that after activation function. It can also be used there.






            share|improve this answer









            $endgroup$

















              0












              $begingroup$

              The main purpose of batch normalisation is not for dealing with overfitting but if you have small batches while training it can have regularization effect. In the paper that it was introduced for dealing with covariat shift, it was mentioned that it should be used before activation function. Consequently, you can use it both in convolutional layers and dense layers, after employing weights and before activation functions. But I've seen people using that after activation function. It can also be used there.






              share|improve this answer









              $endgroup$















                0












                0








                0





                $begingroup$

                The main purpose of batch normalisation is not for dealing with overfitting but if you have small batches while training it can have regularization effect. In the paper that it was introduced for dealing with covariat shift, it was mentioned that it should be used before activation function. Consequently, you can use it both in convolutional layers and dense layers, after employing weights and before activation functions. But I've seen people using that after activation function. It can also be used there.






                share|improve this answer









                $endgroup$



                The main purpose of batch normalisation is not for dealing with overfitting but if you have small batches while training it can have regularization effect. In the paper that it was introduced for dealing with covariat shift, it was mentioned that it should be used before activation function. Consequently, you can use it both in convolutional layers and dense layers, after employing weights and before activation functions. But I've seen people using that after activation function. It can also be used there.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 13 '18 at 15:38









                VaalizaadehVaalizaadeh

                7,58562263




                7,58562263



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Data Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f37889%2fadding-batch-normalization-layer-to-vgg16-network%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    ValueError: Error when checking input: expected conv2d_13_input to have shape (3, 150, 150) but got array with shape (150, 150, 3)2019 Community Moderator ElectionError when checking : expected dense_1_input to have shape (None, 5) but got array with shape (200, 1)Error 'Expected 2D array, got 1D array instead:'ValueError: Error when checking input: expected lstm_41_input to have 3 dimensions, but got array with shape (40000,100)ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (0,)Keras exception: ValueError: Error when checking input: expected conv2d_1_input to have shape (150, 150, 3) but got array with shape (256, 256, 3)Steps taking too long to completewhen checking input: expected dense_1_input to have shape (13328,) but got array with shape (317,)ValueError: Error when checking target: expected dense_3 to have shape (None, 1) but got array with shape (7715, 40000)Keras exception: Error when checking input: expected dense_input to have shape (2,) but got array with shape (1,)

                    Ружовы пелікан Змест Знешні выгляд | Пашырэнне | Асаблівасці біялогіі | Літаратура | НавігацыяДагледжаная версіяправерана1 зменаДагледжаная версіяправерана1 змена/ 22697590 Сістэматыкана ВіківідахВыявына Вікісховішчы174693363011049382

                    Illegal assignment from SObject to ContactFetching String, Id from Map - Illegal Assignment Id to Field / ObjectError: Compile Error: Illegal assignment from String to BooleanError: List has no rows for assignment to SObjectError on Test Class - System.QueryException: List has no rows for assignment to SObjectRemote action problemDML requires SObject or SObject list type error“Illegal assignment from List to List”Test Class Fail: Batch Class: System.QueryException: List has no rows for assignment to SObjectMapping to a user'List has no rows for assignment to SObject' Mystery