ImageFolder is not an alias for DatasetFolder, but uses is as its base class (which was this case for a while now). You are correct: if you need more flexibility in e.g. the image loading etc. you can derive your custom dataset from DatasetFolder.