I'm in Tokyo and I got stopped twice by police officers wanting to check my bike, on a 3 month period (I do 2 rides of 30 mins a day). For basically no reason (other than being a foreigner in a country where the police is racist?)
Now, some "gaijin" saw a business opportunity there and basically this level of safety is over in most big cities. I think it's totally understandable that they target foreigners. Japan is one of the safest places in the world and they want it to remain that way.
Even if you do get stopped for genuine wrong-doing, the worst that happens is you get a talking to or a citation at the nearest kōban. Better yet, if you learn even the tiniest bit of Japanese that will generally set the policeman at ease.
This has stopped recently though... I am wearing a cycling kit, switched to a road bicycle, and riding in traffic. So likely I've dropped out casual thief profile.