Lausanne is a reasonably safe city as long as visitors are sure to take the normal precautions of traveling.  Up until about a decade ago, the Lausannois often left their homes unlocked and their keys in their cars; however, some locals will claim that the influx of refugees has changed that sense of security. Regardless, it is still one of the safest cities in Switzerland and the Lausanne police are there to keep it so.  You are unlikely to hear the sound of police sirens the entire time that you are there.

Petty crime does occur occasionally, usually when there are crowds of people loitering around during the various festivals that the city has.   Simply be aware of your surroundings, keep an eye on your possessions, and you should be just fine.

There is often a group of homeless people and hippie-types hanging around the corner of Rue Mercerie and Les Escaliers de Marche, but they are harmless and will not bother you unless you bother them.  You will also see groups of homeless people around the Place de La Riponne in the early evening, as the local boulangeries donate their breads to be passed out there at the end of every day.   It is good to note that this area pretty much shuts down after 6pm, so you may want to be careful wondering around here after dark. 

The only area to avoid is the far end of Rue de Geneve, away from the Flon area.  This end of the street is often lined with prostitutes as well as individuals with questionable intentions.