  Context. A large fraction of Asymptotic Giant Branch (AGB) stars develop
carbon-rich atmospheres during their evolution. Based on their color and
luminosity, these carbon stars can be easily distinguished from many other
kinds of stars. However, a large number of G, K, and M giants are also
distributed in the same region as carbon stars on the HR diagram. Their spectra
have differences,especially in the prominent CN molecular bands. Aims. We aim
to distinguish carbon stars from other kinds of stars using Gaia's XP spectra,
while providing attribution explanations of key features necessary for
identification, and even discovering additional new spectral key features.
Methods. We proposed a classification model named `GaiaNet', an improved
one-dimensional convolutional neural network specifically designed for handling
Gaia's XP spectra. We utilized the SHAP interpretability model to calculate the
SHAP value for each feature point in a spectrum, enabling us to explain the
output of the `GaiaNet' model and provide further meaningful analysis Results.
Compared to four traditional machine-learning methods, the `GaiaNet' model
exhibits an average classification accuracy improvement of approximately 0.3%
on the validation set, with the highest accuracy even reaching 100%. Utilizing
the SHAP algorithm, we present a clear spectroscopic heatmap highlighting
molecular band absorption features primarily distributed mainly around CN773.3
and CN895.0, and summarize five crucial feature regions for carbon star
identification. Upon applying the trained classification model to the CSTAR
sample with Gaia `xp_sampled_mean' spectra, we obtained 451 new candidate
carbon stars as a by-product.
