Convolutional neural networks on the HEALPix sphere: a pixel-based algorithm and its application to CMB data analysis