Is there any way around this problem?

I have a dataset with over 1000 classes with just 10 images in each classes. In the end, I have to predict if any new image is part of the dataset or not.I tried implementing with my own neural network, tried Siamese networks. My model goes up to 72% val accuracy but shows wrong outputs.I’ve been on this for days.Could you guys help me out ?

Are you applying proper pre-process to input?

Would the images for testing be exactly the same?