probs.max(dim=1)[1] will give you the predicted class index. This class index does not inherit any class information, but will be learned by providing the right labels.
The ground truth label is provided by the Dataset.
Could you explain a bit more about imagelabels.mat?
Is it just a MATLAB matrix containing indices?
If so, do you know how the mapping was created?
Currently it looks like you are trying to map the sorted file paths to the values in imagelabels.mat, which might be wrong. E.g. does image_00001.jpg belong to class77 (MATLAB index)?
Thanks for the info regarding the datasets. I just thought this could be another issue after fixing this one here