Insects must detect and interpret stimuli embedded in a sensory environment of competing stimuli. While sensory environments vary in time and space, individuals may be able to learn local background characteristics, facilitating perceptual learning. This study on host search in butterflies examines the following questions in an ecologically relevant context: i) does cue learning depend on the sensory environment in which learning occurs; and ii) are background characteristics learned, such that performance on novel tasks in the same sensory environment is facilitated? Females of Battus philenor (Papilionidae: Lepidoptera) were trained to different coloured and shaped oviposition targets, against different background colours. Individuals trained to colours on a brown background but tested on a green background performed significantly worse than control individuals which were trained to the same colours but on a green background. Females pre-trained to discriminate green targets from red targets on a green background colour performed significantly better in a novel task (shape learning) involving green shapes on a green background than did individuals trained to discriminate the same colours on a brown background. These two results were unique to particular cue-background combinations, in particular cryptic conditions. Taken together, our results suggest that cue learning depends on an insect's sensory environment, and that learning characteristics of local backgrounds may confer benefits to habitat-faithful individuals.