Novelty signals in the brain are an important driver of exploration and learning in humans and animals. While the perceived novelty of a stimulus is known to depend on previous experience, it remains elusive how stimulus representations in the brain impact novelty computation and downstream novelty-driven behaviors. In particular, existing models of novelty computation fail to account for the effects of stimulus similarities that are abundant in naturalistic tasks. Here, we present a unifying, biologically plausible modeling framework that captures how stimulus representations modulate novelty signals in the brain and influence novelty-driven exploration. By applying our model to two publicly available data sets, we quantify and explain (i) how generalization across similar visual stimuli affects novelty responses in the mouse visual cortex, and (ii) how generalization across nearby locations impacts mouse exploration in an unfamiliar environment. Our model unifies and explains distinct neural and behavioral signatures of novelty, and enables theory-driven experiment design to investigate the neural mechanisms underlying novelty signals and novelty-driven exploration in naturalistic environments.