Hello Kalyan91: I see this is your first post here on PC. So... welcome to PsychCentral... from the Skeezyks!

I hope you find the time you spend here to be of benefit.
We here on PC are not in a position to diagnose you. This is something that must be done by a mental health professional. My lay perspective would be that perhaps this is sort-of an obsessive-compulsive sort of thought process... an unwanted thought that just keeps coming back over-&-over again. It's not unlike an "ear worm"... a song that maddeningly just keeps playing over-&-over in your head.

I would presume you've had this experience.

I know I certainly have!
There is a lot of stuff in the news lately with regard to persons who are transgender what with all of the flap over the use of public restrooms, locker rooms, etc. For some reason the idea of girls you see being transgender has apparently lodged itself in your brain & simply won't leave!

Who knows why these things happen?
My experience has been that trying to force these sorts of things out of your mind only makes them keep coming back stronger than ever. Personally I practice a Buddhist discipline called: "compassionate abiding". When unwanted thoughts come up, I allow them to be there, I lean into them (pay attention to them, focus on them... lightly), I smile to them, & breathe into them. Sometimes I will chuckle to myself at the thought of them. I may even place my hand over my heart as a sign of lovingkindness & compassion for them. They are like misshapen little trolls. But they have no power over me beyond what I cede them. After a few seconds I then drop the story line (in this case the one about how all of the girls you see may be trans...) & then I simply stay with the underlying emotion... whatever it is... anxiety, fear, confusion, etc. & allow it to fade away of it's own accord.
Two things happen as a result of this practice. One is that, over time, these sorts of unwanted thoughts tend to fade. But, second & perhaps of more significance is that we learn we can stay with difficult, unwanted thoughts & emotions without being knocked off balance. We can maintain our equanimity despite whatever challenges life throws at us. This is a most valuable lesson to learn & your current struggle with the unwanted thoughts you describe constitutes an excellent opportunity to start practicing. Perhaps you could even welcome it as a teacher! Wouldn't that be a novel way to approach it? I wish you well...