We apply machine learning algorithms to classify infrared (IR)-selected targets for NASA’s upcoming Spectro-Photometer for the History of the Universe, Epoch of Reionization and Ices Explorer (SPHEREx) mission. In particular, we are interested in classifying young stellar objects (YSOs), which are essential for understanding the star formation process. Our approach differs from previous works, which have relied heavily on broad-band colour criteria to classify IR-bright objects, and are typically implemented in colour–colour and colour–magnitude diagrams. However, these methods do not state the confidence associated with the classification and the results from these methods are quite ambiguous due to the overlap of different source types in these diagrams. Here, we utilize photometric colours and magnitudes from seven near- and mid-IR bands simultaneously and employ machine and deep learning algorithms to carry out probabilistic classification of YSOs, asymptotic giant branch (AGB) stars, active galactic nuclei (AGNs), and main-sequence (MS) stars. Our approach also subclassifies YSOs into Class I, II, III, and flat spectrum YSOs, and AGB stars into carbon-rich and oxygen-rich AGB stars. We apply our methods to IR-selected targets compiled in preparation for SPHEREx which are likely to include YSOs and other classes of objects. Our classification indicates that out of 8308 384 sources, 1966 340 have class prediction with probability exceeding 90 per cent, amongst which $\sim 1.7~{{\ \rm per\ cent}}$ are YSOs, $\sim 58.2~{{\ \rm per\ cent}}$ are AGB stars, $\sim 40~{{\ \rm per\ cent}}$ are (reddened) MS stars, and $\sim 0.1~{{\ \rm per\ cent}}$ are AGNs whose red broad-band colours mimic YSOs. We validate our classification using the spatial distributions of predicted YSOs towards the Cygnus-X star-forming complex, as well as AGB stars across the Galactic plane.