Hi everyone,
I’m trying to develop a pytorch model to classify some synthetic images. The model should identify whether an image contains out-of-place bolts or not (in the attachment there are two examples of images from both classes). I got high accuracy and low loss (98% on the validation set). But if I look on the activation map I see that the model is predicting well but for the wrong reason.
I trained my model for 30 epochs (I saved the weights of the epoch with the best accuracy) with an Adam optimizer and a lr of 0.01 and used batches of 10 images.
IMAGES

  
      
      ImgBB
  
  
    

clean 3

Image clean hosted in ImgBB


  
  
    
    
  
  



  
      
      ImgBB
  
  
    

with-bolts 3

Image with-bolts hosted in ImgBB


  
  
    
    
  
  


Do you know how it could be possible to improve my model pushing it to give more weight to the out-of-place bolts?