Batman is one of the heroes/vigilantes who takes the matter of keeping his secret identity most seriously. Bruce Wayne doesn't just wear glasses like Superman to avoid being recognized by everyone, mainly because he is a celebrity and is among the elite of society.
Fans have debated for years whether Batman's classic mask is enough to conceal his identity, especially now that advanced facial recognition with Artificial Intelligence is available. His mask's defenses have (more or less) fulfilled their role over the years: from having it attached to his suit to a teaser system that causes electric shocks to anyone who tries to remove it.
The design of the mask is thought out literally to the centimeter. A flashback to the comic Batman #150 (Chip Zdarsky, Denys Cowan, Jorge Jiménez and Tomeu Morey) has revealed a measure as absurd as it is original, although it does not always work: Batman's eyes are always open, even if Bruce Wayne is asleep, hypnotized or fainted.
This defensive measure is inspired by an actual indigenous tradition, as ScreenRant notes: wearing masks behind the face to avoid being attacked from behind by predators like tigers. While this passive measure has saved Batman from being unmasked on several occasions, deterring curious onlookers long enough for him to recover or for an ally to intervene, it doesn't always work.
In VidaExtra | This Daredevil story explains why Batman's decision not to kill Joker is much more strategic than you imagine
At VidaExtra | Suicide Squad has brought back all the terror I have instilled as Batman for 15 years and it could have been much worse
At VidaExtra | The Batman of Arkham Knight is a loser. I want to return to Gotham with this Helldivers 2 mod to impose democracy by punching