Can we set individual labels by ourself in supervised learning using resnet

I am new to machine learning and I want to create a convolutional neural network using pytorch and resnet. My dataset consists of different images in different folders. As their names are like, im01, im02, im03, and they are overlapping, so I can’t put them under 1 single folder too.
So, I am looking for a way to train lower layers using pytorch automatically, but I want to train highest layer by myself, so that I can tell the machine that in which folder which type of images are there. Is there any way this is possible, or should I look for some another dataset?
Thanks in advance, please help me guys if possible