Daydreaming is looking less like a vice and more like a virtue the more that neuroscientists and psychologists dig into the phenomenon.

Scientists at Harvard University have now found preliminary evidence that when mice 'daydream' or quietly reflect on something they saw earlier that day, their brains are rewired in a useful way for memory and learning.

That hypothesis still needs to be tested in further experiments, but it seems that when mice are shown a black-and-white checkered pattern, they can still visualize the image in their mind's eye after it is removed from sight.

This 'daydream' effect, where the visual cortex is busy visualizing an image that is no longer there, only occurred when the mouse was unstimulated, in a calm and relaxed state with small pupils.

It is this non-stimulated, dreamy state that scientists at Harvard think could have a similar effect to sleep, consolidating memories and improving learning.

"We wanted to know how this daydreaming process occurred on a neurobiological level, and whether these moments of quiet reflection could be important for learning and memory," explains neurobiologist Nghia Nguyen from Harvard University.

The study included 13 mice, which were shown two different black-and-white images 64 times throughout the day for two seconds a piece in an otherwise non-stimulating environment.

Over the course of several days, these experiments were repeated while the team at Harvard monitored the electrical activity of 7,000 neurons in the brains of eight of the mice, including nerve cells in its visual cortex and hippocampus – a region strongly associated with memory consolidation.

Each of the two images ultimately triggered a different pattern of neural activity in the lateral visual cortex of the mice.

This part of the brain is associated with object recognition and discerning the features of shapes.

The findings suggest that the mouse brain is encoding each image with a different pattern of neural activity.

But what's really interesting is that after these images were replaced by a blank computer screen, the mouse visual cortex sometimes 'reactivated', exciting a similar pattern of neurons to the removed image.

This brief reactivation in the visual cortex was often coupled with sharp-wave ripples in the hippocampus – a sign that the brain was effectively encoding visual information despite the absence of a stimulus.

Over time, brain activity upon seeing an image started to resemble brain activity when daydreaming about that image.

This is a sign that daydreaming was strengthening some neuronal connections while weakening others, creating a more efficient stimulus response overall.

"When you see two different images many times, it becomes important to discriminate between them," explains Nguyen.

"Our findings suggest that daydreaming may guide this process by steering the neural patterns associated with the two images away from each other."

The findings suggest that when the brain is not stimulated, it can slip off into an imagined world, where mental images can actively reorganize the brain's future responses to stimuli.

Whether this also applies to human brains is unknown, but previous studies have shown that asking people to recall an image does increase brain activity in their visual cortex and hippocampus.

Other studies have found that people who daydream more are better at recalling memories in a distracting setting.

"We feel pretty confident that if you never give yourself any awake downtime, you're not going to have as many of these daydream events, which may be important for brain plasticity," argues neurobiologist Mark Andermann from Harvard.

Like many impacts on human health, however, too much of a good thing can be bad. Some scientists think that daydreaming too much or daydreaming about the wrong things can have negative impacts on human cognition, like attention and short-term memory.

For an activity that might consume up to half our waking hours, it's astonishing that we don't know more about our wandering minds.

The study was published in Nature.