Optimal Inference in Crowdsourced Classification via Belief Propagation