Getting Irregular metrics on training

Droid786: <p>Hi,<br>
I am training a model for multi-class classification . But, I am getting really irrelgular output, I also have tried changing the learning rate but it the effect is still the same.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/9/892a75ef350699b646e6801d542a73980ce25580.png" data-download-href="https://discuss.pytorch.org/uploads/default/892a75ef350699b646e6801d542a73980ce25580" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/8/9/892a75ef350699b646e6801d542a73980ce25580.png" alt="image" data-base62-sha1="jzqnS6by8wdqupISANKLos9a94A" width="690" height="475" data-dominant-color="E7F1F9"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">874×602 32.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Below is my code -</p><aside class="onebox githubgist" data-onebox-src="https://gist.github.com/droid786/4069fe9cb16e909eb09ed087b427fa26">
  <header class="source">

      <a href="https://gist.github.com/droid786/4069fe9cb16e909eb09ed087b427fa26" target="_blank" rel="noopener nofollow ugc">gist.github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://gist.github.com/droid786/4069fe9cb16e909eb09ed087b427fa26" target="_blank" rel="noopener nofollow ugc">https://gist.github.com/droid786/4069fe9cb16e909eb09ed087b427fa26</a></h4>

  <h5>code</h5>
  <pre><code class="">
import os
import torch
import numpy as np
from torchvision import datasets
import torchvision.transforms as transforms
import random

import torch.optim as optim
</code></pre>
   This file has been truncated. <a href="https://gist.github.com/droid786/4069fe9cb16e909eb09ed087b427fa26" target="_blank" rel="noopener nofollow ugc">show original</a>

<p>
</p>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>I am really not able to figure out how to try solving it.</p>

mailcorahul: <p>Hi,<br>
From the graph above, it looks like the loss(assuming train loss) is barely changing. Can you give some more insight about the problem? what is the dataset used, image size etc.<br>
Meanwhile, you can do the following:</p>
<ol>
<li>Check if the data is correct(valid ground truth, input to the network is correct).</li>
<li>Try to overfit on a small subset of data.</li>
<li>Try using a higher learning rate from the point where the loss stagnates.</li>
</ol>

Droid786: <p>Hi, Thanks for replying.<br>
I have 10,777 images for a medical dataset, which I divided according to 80-20 rule.<br>
There are 3 classes which I want to classify. Training set distribution is  - 3287,2675,3737 images.<br>
Dev and test set is - 179,180,180.<br>
I am using transfer learning and using efficient net .<br>
Image size is 2048,2048. I am resizing them to different sizes (64,64),(128,128),(224,224),(512,512),(1024,104) but the results are same in every dataset.</p>

mailcorahul: <p>Okay. The dataset is well balanced. Like I said, you can check for annotations and input data correctness.<br>
Also, I have not worked on efficient nets before. In general, 224x224 or 512x512 size should be good enough for image classification. You can also experiment with simple resnet50/densenet161 backbones to see if the network is learning or not.</p>