I think people may be overthinking the self defense part. This isn't the movies. If a bunch of guys jump you or someone shoves a broom handle in your spokes, there isn't much you can do about it. Unless they are absolutely stupid, they will be on top of you before you have much of a chance. I would suggest thinking of defensive riding skills rather than self defense.
Avoiding situations you find dangerous seems the best stratagy. When in areas I find less than safe, I just try to stay moving and aware of my surroundings. The danger point seems to be when you are stopped. Try to time the lights and keep your pace. You can outrun most anyone on foot. Keep your bike in good repair, as well. A mechanical failure can have you stuck for at least several minutes.