This paper describes an algorithm using deep probabilistic model, referred to as sum-product networks (SPNs), for cell classification: it take a trained pathologist to distinguish the human epithelial type 2 cells with 73.3{\%} accuracy. The SPNs reduce generalization errors by maximizing the margin between the conditional probability of the true label and the maximum conditional probability of the label that is not a true label. In the SPNs architecture, the most confusing classes are grouped such that have a common parent sum node, referred to as sub-networks of SPNs (sub-SPNs). The sub-SPNs are one of the solutions to gradient diffusion problems, and are combined with maximum margin learning algorithm. The proposed SPN performed better than all other state-of-the-art algorithms on HEp-2 cells dataset and convolutional neural networks on Feulgen stained cells dataset.