Body: <p>I am currently training an CNN for classification. My training data are 80x80 images, 3 channels, which I have grouped into 25% validation, 75% training, all evenly distributed. I have 3 classes into they are grouped by. On top of that, I reserved the same amount of data as validation for testing.</p>
  <p>The problem appears with the validation and overall results for the model. I have tried many approaches like changing the complexity, changing the batch size, optimizer, epochs, learning rate and so on, but I can t pass the 60-70% validation accuracy which further results in 65% accuracy on testing data.</p>
  <p>I know that my model overfits, but none of the techniques that I have found online worked for me ( data augmentation, robust model, …).</p>
  <p>It reaches the peak of training in any model, but no matter how hard I push and change the parameters, it won t affect the overall accuracy of the model.</p>
  <p>Any info or suggestion that could help me or at least give me a clue.</p>
  <p>I will list a plot with the best accuracy that I have got along with the model and the hyper parameters.</p>
  <p>Some explanation of choosing them:</p>
  <ul>
  <li>batch size of 512 was the best result for my machine; for what I have read the bigger the batch, the better the results should be</li>
  <li>Adam is the best optimezer for all general use cases and also I don't know how to correctly adjust the parameter for SGD and if it is worth trying</li>
  <li>I dindn't implemeted an early stopping mechanism, due to the small size of the model, I could watch and decide when to end the training, sometimes even let it overfit so I can plot the graph more correctly</li>
  </ul>
  <p><a href="https://i.sstatic.net/gwRpXdjI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gwRpXdjI.png" alt="best results ploted" /></a></p>
  <pre><code>tf.keras.layers.InputLayer(input_shape=(80, 80, 3)), # 80x80x3
  tf.keras.layers.RandomFlip(&quot;horizontal&quot;),
  tf.keras.layers.RandomFlip(&quot;vertical&quot;),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Flatten(),
  tf.keras.layers.Dense(512, activation='relu'),
  tf.keras.layers.Dense(num_classes, activation='softmax')
  </code></pre>
  <p>After seeing this I know what you probably thinking...Why would't I increase the number of input data or added dropout? I did, and was the same or even worst.</p>
  <p>So please if the above is to little to pronounce, ask more questions. Thank you in advance!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-03T07:16:17.217Z
Comments.Text: Could you share what the task is? Also, do you have reported accuracy on same or very similar task from a paper, or when compared to human performance on the task? These are important details, because *maybe* there's a change in approach that could help, but also maybe 70% accuracy on this task is a realistic best possible result
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-03T14:26:51.020Z
Comments.Text: @NeilSlater The task is to clasify the images into 3 classes, they are not really well defined (as, for example: dog, cat, elephant), but a more abstract ones, you could even say they are just grouped, reather than classified. As for accuracy, it is reported for the same task. I only can reach the peak ok ~70% no matter what I try. As I saw others results on the same task, it can peak 80-85% accuracy. So yeah...There's plenty of optimization to be done, but I can't find the right tunning for it.
Comments.UserDisplayName: will
Tags: <convolutional-neural-networks><classification><tensorflow><accuracy>
Title: I can’t pass a treshold no matter what I do
UserDisplayName: will
ThreadText: # I can’t pass a treshold no matter what I do
  
  (Asked by: username_0 on 2024-06-02)
  
  I am currently training an CNN for classification. My training data are 80x80 images, 3 channels, which I have grouped into 25% validation, 75% training, all evenly distributed. I have 3 classes into they are grouped by. On top of that, I reserved the same amount of data as validation for testing.
  The problem appears with the validation and overall results for the model. I have tried many approaches like changing the complexity, changing the batch size, optimizer, epochs, learning rate and so on, but I can t pass the 60-70% validation accuracy which further results in 65% accuracy on testing data.
  I know that my model overfits, but none of the techniques that I have found online worked for me ( data augmentation, robust model, …).
  It reaches the peak of training in any model, but no matter how hard I push and change the parameters, it won t affect the overall accuracy of the model.
  Any info or suggestion that could help me or at least give me a clue.
  I will list a plot with the best accuracy that I have got along with the model and the hyper parameters.
  Some explanation of choosing them:
  
  batch size of 512 was the best result for my machine; for what I have read the bigger the batch, the better the results should be
  Adam is the best optimezer for all general use cases and also I don't know how to correctly adjust the parameter for SGD and if it is worth trying
  I dindn't implemeted an early stopping mechanism, due to the small size of the model, I could watch and decide when to end the training, sometimes even let it overfit so I can plot the graph more correctly
  
  
  tf.keras.layers.InputLayer(input_shape=(80, 80, 3)), # 80x80x3
  tf.keras.layers.RandomFlip("horizontal"),
  tf.keras.layers.RandomFlip("vertical"),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.Conv2D(32, 3, activation='relu'),
  tf.keras.layers.MaxPooling2D(),
  
  tf.keras.layers.Flatten(),
  tf.keras.layers.Dense(512, activation='relu'),
  tf.keras.layers.Dense(num_classes, activation='softmax')
  
  After seeing this I know what you probably thinking...Why would't I increase the number of input data or added dropout? I did, and was the same or even worst.
  So please if the above is to little to pronounce, ask more questions. Thank you in advance!
  
  **Tags:** convolutional-neural-networks, classification, tensorflow, accuracy
  > **Comments:**
  > **username_1**: Could you share what the task is? Also, do you have reported accuracy on same or very similar task from a paper, or when compared to human performance on the task? These are important details, because *maybe* there's a change in approach that could help, but also maybe 70% accuracy on this task is a realistic best possible result  
  > **username_0**: @NeilSlater The task is to clasify the images into 3 classes, they are not really well defined (as, for example: dog, cat, elephant), but a more abstract ones, you could even say they are just grouped, reather than classified. As for accuracy, it is reported for the same task. I only can reach the peak ok ~70% no matter what I try. As I saw others results on the same task, it can peak 80-85% accuracy. So yeah...There's plenty of optimization to be done, but I can't find the right tunning for it.  
  
  ---
  
  ## 0 answers
  
  