The suspect approached the woman in Kilmarnock's Dean Park and asked her the time, then grabbed her and began to take off his clothes, Strathclyde Police said.
The man ran off after a nearby dog walker called out to their dog.
The 25-year-old woman, whose baby was in a pram, was not injured but was left very upset by the incident.
Police appealed for information about the incident, which happened at around 11.30am on Sunday.
Detective Inspector Scott McClelland said: "This was a very frightening experience indeed for this young mum.
"We know the man was disturbed during his attack by a particular dog walker calling for their pet, by the name of Brodie.
"I would like to appeal to the owner of that dog, as they may have important information."
The suspect is described as Asian with matted black hair which was brushed forward. He was wearing a dark navy Nike top or training jacket with a white Nike tick on the left-hand side.