  The presence of $Gaia$ DR3 provides a large sample of stars with complete 6D
information, offering a fertile ground for the exploration of stellar objects
that were accreted to the Milky Way through ancient merger events. In this
study, we developed a deep learning methodology to identify ex-situ stars
within the $Gaia$ DR3 catalogue. After two phases of training, our neural
network (NN) model was capable of performing binary classification of stars
based on input data consisting of 3D position and velocity, as well as actions.
From the target sample of 27 085 748 stars, our NN model managed to identify
160 146 ex-situ stars. The metallicity distribution suggests that this ex-situ
sample comprises multiple components but appears to be predominated by the
Gaia-Sausage-Enceladus. We identified member stars of the Magellanic Clouds,
Sagittarius, and 20 globular clusters throughout our examination. Furthermore,
an extensive group of member stars from Gaia-Sausage-Enceladus, Thamnos,
Sequoia, Helmi streams, Wukong, and Pontus were meticulously selected,
constituting an ideal sample for the comprehensive study of substructures.
Finally, we conducted a preliminary estimation to determine the proportions of
ex-situ stars in the thin disc, thick disc, and halo, which resulted in
percentages of 0.1%, 1.6%, and 63.2%, respectively. As the vertical height from
the Galactic disc and distance from the Galactic centre increased, there was a
corresponding upward trend in the ex-situ fraction of the target sample.
