Out of the box code for binary MNIST/CIFAR10?

I was wondering if there was some code out of the box for doing binary classification for MNIST or CIFAR10?

MNIST and CIFAR10 both have 10 categories so I’m not sure how a binary classifier is supposed to work.

it can work if u ran your whole predicting algorithm 10 times and each time you make one of the category as 1 and rest all as 0.