Understanding critical factors in appearance-based gender categorization