ALMA observations show that dusty, distant, massive ($M_* M_ galaxies usually have a remarkable star-formation activity, contributing of the order of $25<!PCT!>$ of the cosmic star-formation rate density at $z and up to $30<!PCT!>$ at $z Nonetheless, they are elusive in classical optical surveys, and current near-IR surveys are able to detect them only in very small sky areas. Since these objects have low space densities, deep and wide surveys are necessary to obtain statistically relevant results about them. will potentially be capable of delivering the required information, but, given the lack of spectroscopic features at these distances within its bands, it is still unclear if will be able to identify and characterise these objects. The goal of this work is to assess the capability of together with ancillary optical and near-IR data, to identify these distant, dusty, and massive galaxies based on broadband photometry. We used a gradient-boosting algorithm to predict both the redshift and spectral type of objects at high $z$. To perform such an analysis, we made use of simulated photometric observations that mimic the Euclid Deep Survey, derived using the state-of-the-art Spectro-Photometric Realizations of Infrared-selected Targets at all-$z$ ( software. The gradient-boosting algorithm was found to be accurate in predicting both the redshift and spectral type of objects within the simulated Euclid Deep Survey catalogue at $z>2$, while drastically decreasing the runtime with respect to spectral-energy-distribution-fitting methods. In particular, we studied the analogue of HIEROs (i.e. sources selected on the basis of a red $H- >2.25$), combining and Spitzer data at the depth of the Deep Fields. These sources include the bulk of obscured and massive galaxies in a broad redshift range, $3<z<7$. We find that the dusty population at $3 z 7$ is well identified, with a redshift root mean squared error and catastrophic outlier fraction of only $0.55$ and $8.5<!PCT!>$ ($ respectively. Our findings suggest that with we will obtain meaningful insights into the impact of massive and dusty galaxies on the cosmic star-formation rate over time.