How can I give high weightage to one class based on training performance

I am training a Resent-18 model on CIFAR- 10 dataset. But my model is failing to learn over label1 and 5 after certain epochs.

One can see the performance of the model on:

Is there any function that can help make my model learn on the labels showing a high loss or having low classification accuracy?

You could try to estimate the weights for the current epoch based on the unreduced loss and recreate a weighted criterion in the next epoch.
To get the raw, unreduced loss use reduction='none' while creating the criterion and check the losses for each sample in the current batch.