How does our brain encode information to Input Space?



Lets say one day I saw a person’s face. then again the next day I saw a person and I realized that this was the same person I saw before.
Now my question is how did I know the similarities? so I thought this must be about the Input space. I think brain encoded similarly when I saw the person’s face for both days.
Is there any theory which explains about how this work? I mean how does it know to encode similar information similarly?


Your question has two parts:
Coding of objects and recognition of familiar objects.
I am fairly certain that nobody has a firm answer on the coding aspect.

HTM theory does offer some insight on the recognition of familiar perceptions; in a nutshell - if the pattern is recognized the related sections of cortex quietly recalls the previously learned pattern. If the pattern is not recognized the related HTM column/neurons burst signifying novelty and triggering learning.

There are known areas of the cortex that work to gather this resonance or novelty and signal “familiarity.” These areas are closely associated with the hippocampus and connecting cortex - areas that are thought to be the seat of your episodic or experiential memory.

The way that I summarize this is as follows: Everything that you learn is framed and parsed in terms of what you have learned before; you learn delta coding based on your prior life experiences. If you extend this all the way back you build on your innate built-in instinctive and emotional wiring as dictated by your genetics.
It is nature first, then nurture.

As an interesting and closely related subject: Déjà vu. This is when you get the feeling of familiarity when it is clear to you that this is a novel scene and it should not be considered as recognized. This is thought to be a partial activation or misfire of this familiarity mechanism. My take on this is that it is possible that some partial factors of prior experiences are combining to match the current situation.