Effective training of convolutional neural networks for face-based gender and age prediction