Novelty signals in the brain drive exploration and learning. While the perceived novelty of a stimulus is known to depend on previous experience, it remains elusive how generalization between familiar and novel stimuli impacts novelty computation. Specifically, existing models of novelty computation fail to account for the effects of stimulus similarities that are abundant in naturalistic tasks. Here, we present a biologically plausible model that captures how stimulus similarities modulate novelty signals in the brain and influence novelty-driven exploration. By applying our model to two publicly available datasets, we show (1) how generalization across similar visual stimuli affects novelty responses in the mouse visual cortex and (2) how generalization across nearby locations impacts mouse exploration in an unfamiliar environment. Our model explains distinct neural and behavioral signatures of novelty, makes mechanistic predictions about synaptic plasticity rules in novelty-computing circuits, and enables theory-driven experiment design.