I don't know of any sure way to tell 100%. many theories abound like females have a slightly rounder dorsal, females are bigger and fatter and I've heard that females have lighter bellies.
IMO, other than the dorsal, the other 2 are subjective to our (fishkeepers) feeding habit and color of substrate and how healthy they are. They will have a more black apprearance when healthy and happy and on a darker substrate and be fatter depending on how well fed.
Edit: spelling