Cerebral cortex supports representations of the world in patterns of neural activity, used by the brain to make decisions and guide behavior. Past work has found diverse or limited changes in the primary sensory cortex in response to learning, suggesting the key computations might occur in downstream regions. Alternatively, sensory cortical changes may be central to learning. To study changes in sensory cortical representations, we trained mice to recognize entirely novel, non-sensory patterns of cortical activity in the primary visual cortex (V1) created by direct optogenetic stimulation. As animals learned to use these novel patterns, we found their detection abilities improved by an order of magnitude or more. The behavioral change was accompanied by large increases in V1 neural responses to fixed optogenetic input. Neural response amplification to novel optogenetic inputs had little effect on existing visual sensory responses. Amplification would seem to be desirable to improve decision-making in a detection task, and thus these data suggest adult cortical plasticity plays a significant role in improving the detection of novel sensory inputs during learning.