title: Difference between Dense(2) and Dense(1) as the final layer of a binary classification CNN?
body: <p>In a CNN for binary classification of images, should the shape of output be (number of images, 1) or (number of images, 2)? Specifically, here are 2 kinds of last layer in a CNN:</p>
  
  <pre><code>keras.layers.Dense(2, activation = 'softmax')(previousLayer)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>keras.layers.Dense(1, activation = 'softmax')(previousLayer)
  </code></pre>
  
  <p>In the first case, for every image there are 2 output values (probability of belonging to group 1 and probability of belonging to group 2). In the second case, each image has only 1 output value, which is its label (0 or 1, label=1 means it belongs to group 1).</p>
  
  <p>Which one is correct? Is there intrinsic difference? I don't want to recognize any object in those images, just divide them into 2 groups.</p>
  
  <p>Thanks a lot!</p>